Exerpad
Lesson · Chapter: Print+10 XP for reading

What is Print?

The print() function is how your program talks to you! It displays text on the screen.

Prefer to watch? This chapter in 100 seconds:

0%
0:00
/
1:41
Video
0:00
1:41

Printing Text

To print text, put it inside quotes and wrap it with print():

python
print("Hello!")
Output
Press Run to see the output.

This shows:

Hello!

You can use single quotes too:

python
print('Hello!')
Output
Press Run to see the output.

Printing Numbers

You can print numbers without quotes:

python
print(42)
print(3.14)
Output
Press Run to see the output.

Printing Multiple Things

Use commas to print several things on one line. Python adds spaces between them:

python
print("I am", 10, "years old")
Output
Press Run to see the output.

Output:

I am 10 years old

Multiple Lines

Each print() starts a new line:

python
print("Line 1")
print("Line 2")
print("Line 3")
Output
Press Run to see the output.

Blank Lines

Call print() with nothing inside to print a blank line:

python
print("Top")
print()
print("Bottom")
Output
Press Run to see the output.

Output:

Top

Bottom

Now let's practice!