编程语言
首页 > 编程语言> > python集合

python集合

作者:互联网

ii=set(12,3,5,6,9,9,8,8)
print(ii)

输出:
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: set expected at most 1 argument, got 8

修改为:
ii=set((12,3,5,6,9,9,8,8))
print(ii)

输出为:
{3, 5, 6, 8, 9, 12}

 

集合  

标签:set,python,print,ii,most,12,集合
来源: https://www.cnblogs.com/Li-JT/p/15067439.html