PythonMastery

Hello World program in Python

The first program everyone writes: print one line of text with print(). What the line does, and how to print more than one line.

The traditional first program. It shows that Python is installed and working, and it teaches the one function you will use more than any other: print().

The program

python
print("Hello, World!")
output
Hello, World!

How it works

Try changing it

Each call to print() starts a new line, so three calls print three lines:

python
print("Hello, World!")
print("My name is Ada.")
print("I am learning Python.")
output
Hello, World!
My name is Ada.
I am learning Python.

Learn the idea: Introduction to Python