I have a list which contains the values:
['1', '3', '4', '4']
I have an if statement which will check if the values are contained within the list then output a statement:
if "1" and "2" and "3" in columns:
print "1, 2 and 3"
Considering the list doesn't contain value "2", it should not print the statement, however it is:
Output:
1, 2 and 3
Can someone explain why this is the case? Is it the way Python reads the list that is making this occur?
Aucun commentaire:
Enregistrer un commentaire