# d = {(1,2,3):3,'a':4} # print(d)# s = set ((1,2,3)) # print(s) 但是# d = {(1,[2,3]):6,'ry':7} # print(d)# s = set((1,[2,3])) # print(s) 不包含list的tuple可以作为dict和set的key ,包含list的tuple不能作为他们的key(因为list可变)。注:定义d的value用冒号
Sign in to make a reply
RY