0

I am trying to understand some python code from the internet in which I found this line:

 if len(u) <> 2:
        # some statements

and:

  if idPlayer <> 0:
        # some statements

Tried to google it, nothing found, not even in the python documentation...

What does the conditional sign "<>" means? When the conditions above are True? Thanks

jwodder
  • 54,758
  • 12
  • 108
  • 124
EshelBM
  • 31
  • 4
  • http://stackoverflow.com/questions/4007289/so-what-exactly-does-from-future-import-barry-as-flufl-do – James Aug 10 '16 at 20:21
  • I think it's the same of `!=`, but I have never seen it in python (I have seen that one in SQL before and it represent not equals) – Yotam Salmon Aug 10 '16 at 20:22
  • Check [this](http://www.tutorialspoint.com/python/python_basic_operators.htm). This was the first link on google after searching: `<> in python` – Shubham Aug 10 '16 at 20:23
  • @ShubhamBhattar: That doesn't come up at all when I perform that search. EDIT: no wait, it's buried further down the result list. – user2357112 Aug 10 '16 at 20:31

1 Answers1

1

It's an alternate version of !=, checking for non-equality.

rscarson
  • 262
  • 3
  • 13
  • 1
    Worth mentioning: it was removed from the language and doesn't work in python3. Don't use it. – wim Aug 10 '16 at 20:32
  • It goes way back to BASIC, by the way, and probably was adopted from there in Python's predecessor, ABC. – kindall Aug 10 '16 at 20:39