Lesson 2 of 30
Lesson 02 — Numbers, toys, and simple math
Title: Use Python as a friendly calculator
Description: Practice numbers with easy examples about toys, candies, points, and coins.
Why it matters for kids: Games, robots, timers, and scores all use numbers.
1. Basic math
print(3 + 2)
print(10 - 4)
print(6 * 3)
print(12 / 4)Python knows the usual math symbols:
| Symbol | Meaning |
|---|---|
+ | add |
- | subtract |
* | multiply |
/ | divide |
2. Toy shop examples
toy_cars = 4
toy_robots = 2
total_toys = toy_cars + toy_robots
print("Toy cars:", toy_cars)
print("Toy robots:", toy_robots)
print("Total toys:", total_toys)3. Score counter
score = 0
score = score + 10
print("After level 1:", score)
score = score + 20
print("After level 2:", score)
score = score - 5
print("After touching lava:", score)4. More easy examples
cookies = 12
friends = 3
cookies_for_each_friend = cookies / friends
print("Each friend gets", cookies_for_each_friend, "cookies.")minutes = 5
seconds = minutes * 60
print(minutes, "minutes is", seconds, "seconds.")coins = 7
new_coins = 4
print("Now I have", coins + new_coins, "coins.")5. Mini challenge
Click each example to open it.
Example 1
Print the answer to 5 + 3.
Example 2
Print the answer to 10 - 4.
Example 3
Print the answer to 3 * 2.
Example 4
Print the answer to 8 / 2.
Example 5
Create apples = 4 and print it.
Example 6
Create coins = 10 and add 5.
Example 7
Count 3 toy cars and 2 toy robots.
Example 8
Subtract 1 cookie from 6 cookies.
Example 9
Multiply 4 stickers by 3 pages.
Example 10
Make a score that grows by 10 points.