roll_number = [47, 64, 69, 37, 76, 83, 95, 97]
sample_dict = {'John': 47, 'Emma': 69, 'Kelly': 76, 'Jason': 97}
for i in list(roll_number):
if i in sample_dict.values() is False:
roll_number.remove(i) #it doesnt come down here, even though it gets 'False' before
print(roll_number)
i in sample_dict.values()
returns False
, I checked it by printing result of this condition by itself, outside of if
statement, but my programm doesn't go to roll_number.remove(i)
like it doesn't get False
, but it does, so I don't understand what's wrong.