The print() Function
A free lesson from Swipe Coding · Python, level 2 · updated October 2026
By the Swipe team, founded by Colin · how we make lessons
The print() function displays output in the terminal — it is how a Python program communicates with whoever is running it. You give print() the value you want to show by placing it inside the parentheses, and it can display text, whole numbers, decimals, and more.
print("Hello!")
print(42)
print(3.14)print() can also accept several values at once, separated by commas. When you do this, print() automatically places a single space between each value and joins everything into one line of output.
name = "Ada"
age = 36
print("Name:", name, "Age:", age)You can customize how print() joins multiple values using its sep keyword argument, which stands for "separator" — by default it is a single space (" "). You can also control what print() adds after everything is printed using its end keyword argument, which defaults to a newline character ("\n"), moving the cursor down to the next line for whatever gets printed next.
print("a", "b", "c", sep="-")
print("Hi", end="")
print(" there!")By default, the sep keyword argument of print() places a single ____ between each value you pass to it.
What does the end keyword argument of print() control?
By default, print() automatically starts a new line after printing its output.
Keep your streak going in Swipe Coding
Swipe through every level of Python on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.
Get the Swipe apps →