How to use SET in python

来源:互联网 发布:淘宝宝贝链接怎么缩短 编辑:程序博客网 时间:2024/05/18 01:00

set is a very useful tool in python.

You can set a set like this:

s = set(['.', c])# so . and c is included in the set s# also, we can add items to the set s like this:<span><span>s.add(['R'])</span></span>

if one item is already in the set s, it cannot be added to the set s again.

0 0
原创粉丝点击