Let's say I have a list with different values, like this:
[1,2,3,'b', None, False, True, 7.0]
I want to iterate over it and check that every element is not in list of some forbidden values. For example, this list is [0,0.0]
.
When I check if False in [0,0.0
] I get True
. I understand that python casts False
to 0
here - but how I can avoid it and make this check right - that False
value is not in [0,0.0]
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…