The dragon explains
The Dragon's Challenge
The dragon: You've learned three things from me. Let me remind you what they are, because you'll need all of them.
The dragon: One: print() says a thing, and each print makes its own line — even an empty one.
example.pyPython 3print("first")print("")print("third")
Outputfirst thirdThe dragon: Two: sep changes what goes BETWEEN things, and end changes what comes after.
example.pyPython 3print("a", "b", sep="-")Outputa-bThe dragon: Three: quotes mean 'say these symbols'. No quotes means 'work this out first'.
example.pyPython 3print("6 * 7")print(6 * 7)
Output6 * 7 42The 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.
Question 1 of 2
I need to say cost:99 on one line. Which tool does that need?
question.pyPython 3print("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.
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
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
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 realStuck three times? The game offers the answer — unasked.