Sha256: 9a02bf72a8e629108534bd8429fac067b3d604a954402c26a333c10e20ddadd7

Contents?: true

Size: 434 Bytes

Versions: 10

Compression:

Stored size: 434 Bytes

Contents

{{works with|Python|2.4}}
print "Hello world!"

The same using sys.stdout
import sys
sys.stdout.write("Hello world!\n")

In Python 3.0, print is changed from a statement to a function.

{{works with|Python|3.0}} (And version 2.X too).
print("Hello world!")

'''An easter egg'''
The first two examples print <code>Hello, world!</code> once, and the last one prints it twice.
import __hello__

import __phello__

import __phello__.spam

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/hello_world.text/python.txt
zettacode-0.1.6 files.zettacode/hello_world.text/python.txt
zettacode-0.1.6 files.zettacode2/hello_world.text/python.txt
zettacode-0.1.5 files.zettacode/hello_world.text/python.txt
zettacode-0.1.5 files.zettacode2/hello_world.text/python.txt
zettacode-0.1.4 files.zettacode/hello_world.text/python.txt
zettacode-0.1.4 files.zettacode2/hello_world.text/python.txt
zettacode-0.1.3 files.zettacode/hello_world.text/python.txt
zettacode-0.1.2 files.zettacode/hello_world.text/python.txt
zettacode-0.1.1 zettacode.files/hello_world.text/python.txt