Unit 1 of 2

Printing

1 min Updated Jun 2026

Before you can build anything useful, you need a way to see what your code is doing. That’s what print() is for.

Your first line of code

print("Hello, world!")
Hello, world!

You just told Python to display a piece of text. The text goes inside the parentheses, wrapped in quotes. Run it and it appears — immediately, exactly as written.

This is how programmers check that things are working. Not a guess, not an assumption. You print it and you see it.

Printing different types

print() works on anything — text, numbers, booleans.

print("Montreal")
print(42)
print(3.14)
print(True)
Montreal
42
3.14
True

No quotes needed around numbers or booleans. Python knows what they are.

print() displays values to the screen. It works on any type, accepts multiple values separated by commas, and formats cleanly with f-strings. The sep and end parameters give you control over spacing and line breaks when you need it.