Python Forum
py2 to py3 conversion - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: py2 to py3 conversion (/thread-18364.html)



py2 to py3 conversion - Vysero - May-14-2019

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?


RE: py2 to py3 conversion - snippsat - May-14-2019

(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.