r/learnpython • u/Arag0ld • Apr 07 '20
What's the difference between != and is not?
If I say
if x != 5;
print(x)
and
if x is not 5;
print(x)
is there a difference?
332
Upvotes
r/learnpython • u/Arag0ld • Apr 07 '20
If I say
if x != 5;
print(x)
and
if x is not 5;
print(x)
is there a difference?
1
u/R_Olivaw_Daneel Apr 07 '20
Awesome, thank you for this explanation. So in the case of `dict` would the `__eq__` only be shallow checks then?