What Does print() Do in Python? A Kid-Friendly Explanation

The command that gives the dragon its voice.

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

The dragon explains

What print() actually does

  1. The dragon: You just made me speak! Let me show you what actually happened there.

  2. The dragon: print is a command. You give it something, and it says it out loud.

    example.pyPython 3
    print("Wake up, dragon!")
    OutputWake up, dragon!
  3. The dragon: The brackets are how you hand something to print. Nothing gets said without them.

    example.pyPython 3
    print("Wake up, dragon!")
  4. The dragon: The quotes matter too. They mean 'these are words, exactly as written' — so I say them exactly as written.

    example.pyPython 3
    print("Hello")
    OutputHello
  5. The dragon: And every print() gets its own line. Two prints, two lines. Always.

    example.pyPython 3
    print("First")print("Second")
    OutputFirst Second

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

    How many lines will I say here?

    question.pyPython 3
    print("Left")print("Right")print("Middle")
    • Three linesCorrect
    • One line, with all the words on it
    • Two lines — the last one repeats

    Why: Three prints, three lines, in the order you wrote them: Left, then Right, then Middle. I go top to bottom, always.

  2. Question 2 of 2

    What will I say here?

    question.pyPython 3
    print("dragon")
    • dragonCorrect
    • "dragon" — with the quotes
    • Nothing — dragon isn't a real word to Python

    Why: I say dragon, with no quote marks. The quotes tell Python where your words begin and end; they never get spoken.

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

    A rune door stands between the dragon and its gold. Runes are fussy: this one opens only when it hears the exact words carved on it — hello dragon. The dragon walks up to it; you give it the words to say.

  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.