👋 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.
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:
Several lines
Swap the order of the lines. What happens to the output?
Which line correctly prints the word Hello?
print(Hello)
print("Hello")
Print("Hello")
print "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.
Numbers vs. text
Try print(10 * 5). The * symbol means multiply.
What does this print?
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