DPython for KidsModule 2 · Lesson 2.2
LESSON 2.2 · 35 MINUTES

Numbers and Calculations

Python can check calculations quickly while you focus on the problem.

Discover

  • Numbers do not need quotes.
  • Use +, -, * and / for arithmetic.
  • Parentheses make the intended order clear.

Try, explain and change

Try: A quiz awards 12 points for round one and 8 points for round two. Calculate 12 + 8 in Python and print exactly “20”. Do not type the answer as a quoted string.

Change: Predict the new score if round two awards 5 points instead, then run it.

SAFE PYTHON RUNNER

Try the challenge

No files · no network · safe lesson commands only

A quiz awards 12 points for round one and 8 points for round two. Calculate 12 + 8 in Python and print exactly “20”. Do not type the answer as a quoted string.

Target output
20
Match the lines and order. Your code must use the lesson concept.

The runner supports this pathway’s controlled Python concepts while blocking packages, files, networks and system commands.

Output
Your output will appear here.
DEBUG DETECTIVE

Find the bug

print("12" + 8)
Show debugging clue

Quoted 12 is text, but 8 is a number. Remove the quotes.

QUICK CHECK

Which operator multiplies numbers?

+

Not this time. Review Discover and try again.

*

Correct — well reasoned.

/

Not this time. Review Discover and try again.

Create and reflect

Create: Make a three-line score calculator using addition, subtraction and multiplication.

Reflect: How are numbers different from text in Python?

Stretch practice · self check

Add a third round worth 6 points; show your calculation and predicted final score.

Edit and run your code again to explore this variation. It does not change lesson completion.