Hello, World!

Getting Started, lesson 1 of 5

👋 Getting Started, lesson 1 of 5

Hello, World!

Write and run your very first line of Python.

6 min

1 exercise

2 quizzes

0/3 solved

Getting Python ready… examples can run in a moment.

Welcome! A program is a list of instructions for the computer. Python reads them from top to bottom and does exactly what they say.

The first instruction everyone learns is print(). It shows whatever you put between the parentheses. Text must be wrapped in quotes, which makes it a string.

Example

Your first program

Tap Run. Then change the text inside the quotes to your own name and run it again.

Each print() starts a new line. Add more lines and Python runs them one after another:

Example

Several lines

Swap the order of the lines. What happens to the output?

Quiz

Which line correctly prints the word Hello?

print() works with numbers too. Numbers don't need quotes, and Python can do math before printing. But careful: anything inside quotes is just text, even if it looks like math.

Example

Numbers vs. text

Try print(10 * 5). The * symbol means multiply.

Quiz

What does this print?

Exercise

A tiny poem

Finish the poem so the program prints these three lines, in this order:

Roses are red
Violets are blue
Python is fun