#集合本身就像无值的字典 list1 = set([1,2,3,4]) list2 = {1,2,3,4} print('list1 == list2?:',list1==list2)#list1 == list2?: True print('list1 is list2?:',list1 is list2)#list1 is list2?: False #集合是无序的 S = set('spam') print(S)#输出的结果为{'m', 'p', 'a', 's'} S.add('alot…