jeudi 25 juin 2015

Python if not == vs if !=

What is the difference between these two lines of code:

if not x == 'val':

and

if x != 'val':

Is one more efficient than the other?

Would it be better to use

if x == 'val':
    pass
else:

Aucun commentaire:

Enregistrer un commentaire