Logo

Programming-Idioms

History of Idiom 1 > diff from v72 to v73

Edit summary for version 73 by Wohlfe:
[Python] Python 3 compatibility, Python 2 will be unmaintained as of 2020

Version 72

2019-09-26, 15:57:37

Version 73

2019-09-26, 16:57:35

Idiom #1 Print Hello World

Print a literal string on standard output

Idiom #1 Print Hello World

Print a literal string on standard output

Imports
Imports
from __future__ import print_function
Code
print "Hello World"
Code
print("Hello World")
Comments bubble
This works only in Python 2 (not in Python 3).
Comments bubble
This is for Python 2, but maintains compatibility with Python 3.
Doc URL
https://docs.python.org/2/library/future_builtins.html