markdown-here icon indicating copy to clipboard operation
markdown-here copied to clipboard

Use print() function in both Python 2 and Python 3

Open cclauss opened this issue 6 years ago • 4 comments

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.

cclauss avatar Apr 04 '19 09:04 cclauss

Agree! Unfortunately we can't submit PRs for the wiki

interrogator avatar Feb 18 '20 14:02 interrogator

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

cclauss avatar Mar 19 '20 08:03 cclauss

I agree, and everyone should use python 3 now

marie-bnl avatar Mar 26 '21 13:03 marie-bnl

@adam-p Bump on this one please.

cclauss avatar Mar 26 '21 13:03 cclauss