Practice Challenge: Everything About Python print()

Everything at once — no new tricks, just choosing the right tool.

  • Lesson 4 of 5
  • Free
  • Ages 10+
  • 3 hands-on levels
Try this lesson interactivelyReal Python, running in your browser.

The dragon explains

The Dragon's Challenge

  1. The dragon: You've learned three things from me. Let me remind you what they are, because you'll need all of them.

  2. The dragon: One: print() says a thing, and each print makes its own line — even an empty one.

    example.pyPython 3
    print("first")print("")print("third")
    Outputfirst third
  3. The dragon: Two: sep changes what goes BETWEEN things, and end changes what comes after.

    example.pyPython 3
    print("a", "b", sep="-")
    Outputa-b
  4. The dragon: Three: quotes mean 'say these symbols'. No quotes means 'work this out first'.

    example.pyPython 3
    print("6 * 7")print(6 * 7)
    Output6 * 7 42
  5. The dragon: That's everything. The challenge ahead adds nothing new — it just asks you to pick the right one each time.

Quick check

Check your understanding

Say your answer out loud before reading the marked one. Every wrong option is a mistake real beginners make.

  1. Question 1 of 2

    I need to say cost:99 on one line. Which tool does that need?

    question.pyPython 3
    print("cost", 99, ???)
    • sep=":"Correct
    • end=":"
    • Nothing — the comma already does it

    Why: sep=":" replaces the space between the things you hand me, giving cost:99. Remember: sep is between, end is after.

  2. Question 2 of 2

    Which of these makes me say 20 — the number, not the symbols?

    • print(4 * 5)Correct
    • print("4 * 5")
    • print("20")

    Why: print(4 * 5) hands Python a sum to solve, and it gives me 20. Without quotes, Python calculates; with quotes, I just read.

In the game

What you'll practice

Three levels in the game: one guided first try with the shape of the answer already there, then two to solve on your own.

  1. 1

    GuidedYour first try

    Before the real challenge, a warm-up. The dragon wants ONE line that says its name, then a dash, then how many coins it has — using a separator, not spaces.

  2. +2

    PracticeTwo more, on your own

Try it yourself — in real Python.

This lesson is part of a free topic: every lesson in it is free, and no card is needed.

Start this lesson for real

Stuck three times? The game offers the answer — unasked.