What is the difference between these two lines of code:
if not x == \'val\':
and
if x != \'val\':
Is one
It's about your way of reading it. not operator is dynamic, that's why you are able to apply it in
not
if not x == 'val':
But != could be read in a better context as an operator which does the opposite of what == does.
!=
==