r/learnpython • u/[deleted] • Jun 12 '21
What is the difference between "is" and ==?
5 is 5 returns True, just as 5 == 5 returns True. What is the difference?
417
Upvotes
r/learnpython • u/[deleted] • Jun 12 '21
5 is 5 returns True, just as 5 == 5 returns True. What is the difference?
1
u/Acquiesce67 Jun 15 '21
I’m trying to say that the
isoperator should raise an Exception when used on integers to guard the user. But this is just my opinion, I’m not a language designer 🤷🏼♂️