Practice Challenge: A Full Python Character Sheet

Everything you know about boxes, at once.

  • 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 Full Sheet

  1. The dragon: You know three things now: make a box, change a box, and print several boxes together.

  2. The dragon: Making one: put a value in, no print yet.

    example.pyPython 3
    gold = 100
  3. The dragon: Changing one: read the old value, work out the new one, save it back.

    example.pyPython 3
    gold = gold + 30
  4. The dragon: Printing several, labelled: words and boxes mixed with commas — and it shows the UPDATED value.

    example.pyPython 3
    print("Gold:", gold)
    OutputGold: 130
  5. The dragon: The challenge ahead just asks you to use all three, in the right order.

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 1

    gold = 100, then gold = gold + 30. What does print(gold) say?

    question.pyPython 3
    gold = 100gold = gold + 30print(gold)
    • 130Correct
    • 100
    • 30

    Why: 100 + 30 = 130, and that gets saved back into gold. The box remembers the update.

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: make three boxes (name, level, gold), then print each one, labelled, on its own line.

  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.