markdown-here
markdown-here copied to clipboard
Use print() function in both Python 2 and Python 3
In both...
- https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code
- https://github.com/adam-p/markdown-here/wiki/Markdown-Here-Cheatsheet#code
s = "Python syntax highlighting"
print s
Should become...
s = "Python syntax highlighting"
print(s)
...because legacy print statements are syntax errors in Python 3 but print() function works as expected in both Python 2 and Python 3. The example will be more readable if it does not feature a syntax error.
Agree! Unfortunately we can't submit PRs for the wiki
@adam-p Bump on this one please.
Legacy print statements were definitively removed from Python on 1/1/2020 and they are now syntax errors and are therefor highlighted in red.
I agree, and everyone should use python 3 now
@adam-p Bump on this one please.