Course: Term 2: Math Wizard
Duration: 60 minutes
Term: 2 of 8 | Week: 1 of 9
Welcome back, coder! Before we unlock Python's math superpowers, let's dust off everything you learned in Term 1. By the end of today you will have:
print() command and text patternslen(), and str()input() for asking questions"HELLO AGAIN, PROGRAMMER! 🤖💙 I missed you! Can you believe it — you already finished a WHOLE term of Python. You wrote programs, built a game, and squashed real bugs. Today we're not learning anything brand-new. Instead, we're going to wake up your Python brain and remember all the amazing things you already know. Think of it as stretching before a race. Ready? Let's warm up!"
This is a review lesson. We'll move quickly through each Term 1 skill with a tiny example and a "Your Turn" challenge. Don't just read — type every example into Trinket and run it. Your fingers remember more than your eyes!
💡 Zoom Tip: Keep Zoom and Trinket side by side, just like last term.
print() and Patternsprint() is how Python talks. Remember the megaphone? 📣
print("I'm back and ready to code!") print("⭐" * 15) print("=" * 25)
"⭐" * 15 repeats a string 15 times (great for borders and rows!)"a" + "b" joins two strings togetherYour Turn: Print your name inside a border made of - characters.
A variable is a labeled box that stores a value so you can use it again.
player = "Ama" score = 100 print(player) print(score)
Remember the rules:
= means "store this value", NOT "equals" like in mathshigh_score, not HighScore or high scorescore = score + 50Your Turn: Make a variable called favourite_food and print it.
This one matters a LOT this term! Python treats text and numbers differently.
| Value | What it is | Example |
|---|---|---|
"10" | a string (text, has quotes) | age = "10" |
10 | an integer (a number, no quotes) | age = 10 |
print("10" + "5") # Joins text → 105 print(10 + 5) # Adds numbers → 15
😲 See the difference? Quotes turn a number into text. Keep this in your back pocket — in a few weeks it will be the key to making calculators work!
Your Turn: Predict the output of print("2" + "2") before you run it. Were you right?
len(), and str()Strings have built-in superpowers you call with a dot:
name = "brightbyte" print(name.upper()) # BRIGHTBYTE print(name.title()) # Brightbyte print(len(name)) # 10 (counts the letters)
And when you want to glue a number onto text with +, wrap it in str():
age = 11 print("I am " + str(age) + " years old")
Your Turn: Print your name in ALL CAPS, then print how many letters it has.
Comments start with #. Python ignores them — they're notes for humans:
# This line greets the player print("Welcome!")
F-strings are the cleanest way to mix text and variables. Put an f before the quotes and drop variables inside { }:
name = "Kwame" age = 11 print(f"Hi {name}, you are {age} years old!")
Compare that to the old + way:
print("Hi " + name + ", you are " + str(age) + " years old!")
Same result — but the f-string is shorter and easier to read. You can even do work inside the braces:
print(f"Your name in caps is {name.upper()} ({len(name)} letters)")
BrightByte says: "F-strings are my favourite! Whenever you're combining words and variables, reach for an f-string first."
Your Turn: Write an f-string that says "[your name] is learning Python!" using a variable.
input() — Asking QuestionsNear the end of Term 1 you learned how to make programs interactive with input(). It pauses the program and waits for the user to type:
favourite = input("What's your favourite animal? ") print(f"Cool! I like {favourite} too. 🐾")
⚠️ Remember: input() always gives you back text (a string) — even if the user types a number. That will matter a LOT this term when we start doing math with what people type!
Your Turn: Ask the user for their name, then greet them with an f-string.
Try these to prove your Python brain is fully awake!
name = "Your Name" age = 11 hobby = "coding" print("=" * 30) print(f" All About {name.upper()}") print("=" * 30) print(f"Age: {age}") print(f"Hobby: {hobby.title()}") print("⭐" * 30)
# Ask two questions and reply nicely first = input("What's your first name? ") mood = input("How are you feeling today? ") print(f"Nice to meet you, {first.title()}!") print(f"I hope your {mood} day gets even better. 😊")
This code has a mistake. Can you spot and fix it?
<details> <summary>Need a hint?</summary>age = 12 print("Next year you will be " + age + 1)
You can't add a number onto text with +. Either use str() around the number, or (better!) use an f-string:
print(f"Next year you will be {age + 1}")
| Skill | Example |
|---|---|
print("Hi!") | |
| Pattern | "⭐" * 10 |
| Join text | "a" + "b" |
| Variable | score = 100 |
| String method | name.upper(), name.title() |
| Count characters | len(name) |
| Number → text | str(age) |
| Comment | # a note for humans |
| F-string | f"Hi {name}!" |
| Ask a question | input("Your name? ") |
| Word | Meaning |
|---|---|
| Variable | A labeled box that stores a value |
| String | Text, written inside quotes |
| Integer | A whole number, no quotes |
| Method | A built-in action you call with a dot, like .upper() |
| F-string | Text starting with f that holds variables in { } |
Week 2: Python Does Math!
Now that your Python brain is warmed up, next week we unlock Python's secret superpower — it's an incredible calculator!
Sneak peek:
print(5 + 3) # 8 print(6 * 7) # 42 print(100 / 4) # 25.0
You'll turn Python into a super-calculator and start building toward your very own calculator app. Get ready, Math Wizard! 🧙♂️
Look how much you remembered:
print() and patterns with * and +len(), and str()input() for interactive programsBrightByte says: "See? It's all still in there! Your Term 1 skills are the foundation for EVERYTHING we build in Term 2. Now that we're warmed up, let's go discover Python's math superpowers. I'll see you next week, Math Wizard! 🚀"
KidsLearnAI - Empowering the Next Generation with AI Education
www.kidslearnai.ca
Instagram: @kids_learn_ai
Welcome back — this term is going to be amazing! 🐍✨
Sign in to track your progress