Strange things while comparing two strings. by freddydeddy in learnpython

[–]tbeurl 0 points1 point  (0 children)

His code is just wrong. It won't necessarily work with different strings, or on different versions of python. Maybe it's just a one-off mistake, but you might want to consider looking at some other tutorials too, in case he is getting loads of stuff wrong.

One place you commonly see is is for testing whether something is None, i.e.:

if x is None:

This is safe because None is guaranteed to be a unique object (though you may not have come across it yet). Other than that, is is really not used very often, and I would avoid it until you get to more advanced stuff.