CurriculumPython print() for KidsTelling print HOW to speak

Python print() sep and end Arguments Explained

sep and end — the settings that change the shape of what I say.

Lesson 2 of 5FreeAges 10+
Try this lesson interactively →

Telling print HOW to speak

You've been telling me WHAT to say. Now I'll show you how to change HOW I say it.

First: print() can take more than one thing at once. Just put a comma between them.

print("Fire", "Ice")

Output

Fire Ice

Notice the space between them? I put that there myself. You never typed it.

print("Fire", "Ice")

Output

Fire Ice

That space is a setting called sep — short for separator. You can change it to anything.

print("Fire", "Ice", sep="-")

Output

Fire-Ice

Set it to nothing at all, and the words run straight together.

print("Fire", "Ice", sep="")

Output

FireIce

There's a second setting: end. It's what I say AFTER everything else — normally a new line.

print("Fire")
print("Ice")

Output

Fire
Ice

Change end to "" and I don't start a new line at all. I just keep going.

print("Fire", end="")
print("Ice")

Output

FireIce

Check your understanding

What will I say here?

print("day", "night", sep="/")
  • day/night
  • day night/
  • day night sep="/"

Why: sep replaces the space I'd normally put between things, so the slash goes in the middle: day/night. It changes what's BETWEEN, never what's at the end.

How many lines will I say here?

print("up", end="")
print("down")
  • One line: updown
  • Two lines: up, then down
  • One line: up down

Why: end="" replaces the new line with nothing at all, so the next print starts right where the last one stopped. One line, and the words run together: updown.

What you'll practice

The dragon wants to say your name and your title together, in one breath — not as two separate lines. Hand print() two things at once.

Start this lesson for real →

More from this topic

Telling print HOW to speak is one lesson inside Python print() for Kids — see the full lesson order and what the whole topic covers.

View the full topic →