What is the meaning of <> in Python?
I tried to search it on Google, but I can not get into the search query ...
I have not seen this in any other language, otherwise I would try to find it.
<> is an alternative spelling of != , an inequality check statement. IIRC, it was removed in Python3.
<>
!=
>>> "foo" <> "bar" True >>> "foo" <> "foo" False
This is an obsolete inequality operator. See the Python documentation.
! = can also be written <>, but this obsolete use is preserved in the reverse order of compatibility only. New code should always use! =.
This is the same as! = ("Not equal")
<> means not equal to . <> and != have the same meaning.
not equal to
From docs :
The forms <> and! = Are equivalent; for consistency with C,! = is preferred; where! = indicated below <> is also accepted. <> spelling is considered obsolete.
the operator & lt> is the same as! =, which means not equal
if thing1 <> thing2: code here