The dragon explains
Boxes and print, together
The dragon: You have used one box at a time so far. Now let us use several together.
The dragon: print() can take many things at once, remember — boxes and words, mixed freely.
example.pyPython 3name = "Ember"age = 200print(name, "is", age, "years old")
OutputEmber is 200 years oldThe dragon: Notice: name and age have NO quotes because they are boxes. The other words DO, because they are just text.
example.pyPython 3print(name, "is", age, "years old")The dragon: You can also combine two boxes into a brand new number.
example.pyPython 3pile_one = 120pile_two = 35print(pile_one + pile_two)
Output155The dragon: Python reads BOTH boxes, adds them together, then says the answer. Neither box changes.
example.pyPython 3print(pile_one + pile_two)
Quick check
Check your understanding
Say your answer out loud before reading the marked one. Every wrong option is a mistake real beginners make.
Question 1 of 2
What will I say here?
question.pyPython 3coins = 40gems = 10print(coins + gems)
- 50Correct
- coins + gems
- 4010
Why: Python reads both boxes, adds 40 and 10, and says the result: 50. Both boxes stay unchanged.
Question 2 of 2
What will I say here?
question.pyPython 3name = "Ember"print(name, "the dragon")
- Ember the dragonCorrect
- name the dragon
- "Ember" the dragon
Why: name has no quotes, so I look inside it: Ember. The rest has quotes, so I say those words exactly. Together: Ember the dragon.
In the game
What you'll practice
Four levels in the game: one guided first try with the shape of the answer already there, then three to solve on your own.
- 1
GuidedYour first try
The dragon has a name AND an age now. Say both together, on one line, properly labelled so it reads like a sentence.
- +3
PracticeThree 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 realStuck three times? The game offers the answer — unasked.