In IPython 3 interactive shell:
In [53]: set2 = {1, 2, True, "hello"}
In [54]: len(set2)
Out[54]: 3
In [55]: set2
Out[55]: {'hello', True, 2}
Is that because 1 and True get the same interpetation so given that set eliminates duplicates, only one of them (True) gets to stay?
How can we keep both?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…