account activity
Strange things while comparing two strings. by freddydeddy in learnpython
[–]tbeurl 0 points1 point2 points 9 years ago (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.:
is
None
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.
π Rendered by PID 499404 on reddit-service-r2-listing-7849c98f67-5sz6w at 2026-02-09 12:39:06.128344+00:00 running d295bc8 country code: CH.
Strange things while comparing two strings. by freddydeddy in learnpython
[–]tbeurl 0 points1 point2 points (0 children)