student = {
'Tom',
'Jim',
'Mary',
'Tom',
'Jack',
'Rose'}
print(student)
if(
'Rose' in student) :
print(
"Rose 在集合中")
else :
print(
"Rose 不在集合中")
a = set(
'abracadabra')
b = set(
'alacazam')
print(a)
print(b)
print(a - b)
print(a | b)
print(a & b)
print(a ^ b)
转载于:https://www.cnblogs.com/bilaisheng/p/10210955.html