So, I'm making a python cheat sheet for myself, and when I started covering comparison operators, I noticed these two:
a = 1
b = 2
if a != b:
print("Dunno")
if a <> b:
print("Dunno")
I'm using python 2.7 and was curious if there's a difference between the two operators?
As described in the documentation, they are the same. <> is deprecated and was removed in Python 3, so you should use !=.
<> is deprecated. Other than that, no.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With