Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
py2 to py3 conversion
#1
Hey guys, its been a while since I have worked with Python. I remember there were a few changes when py moved from 2 too 3. I am getting a syntax error with this code:

if old_contents <> new_contents:
This is a python conversion error right? What would this line be in py3?
Reply
#2
(May-14-2019, 03:40 PM)Vysero Wrote: few changes when py moved from 2 too 3
More than a few Wink
if old_contents != new_contents:
Not equal !=,<> was rare also in Python 2.
Here a advice from Python 2.2(2001) doc.
Quote:!= is the preferred spelling; <> is obsolescent.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020