vendredi 29 mai 2015

Is there a difference between "if not x in mylist:" and "if x not in mylist:" [duplicate]

This question already has an answer here:

Is there any difference between the two?

t = [1,2,3,4]
if 5 not in t:
    print "ok"
if not 5 in t:
    print "ok"

ok
ok

Aucun commentaire:

Enregistrer un commentaire