🐍 Python Variables Adventure - Day 2
Learn by doing! Complete each exercise step by step! ✨
1 What are Variables? 📦
💡
Learn: Variables are like boxes that store information. You can put things in them and take them out!
Try this: Type the code below and click Run. Watch what happens!
🤔
What happened? The variable "name" is like a box. First we put "Alex" in it, then we replaced it with "Jordan"!
2 Numbers vs Text 🔢
💡
Discovery Time: What happens when you add text vs numbers? Try both examples!
✨
Cool discovery: "5" + "3" = "53" (text joining), but 5 + 3 = 8 (math!). Text can be multiplied too!
3 Reading Input 🎤
💡
Your Turn: This code asks for YOUR name and age. Click Run and type in the pop-up boxes!
4 Math Time! ➕➖✖️➗
💡
Challenge: Change the numbers and see different results. What's 100 + 50? Try it!
5 Build a Calculator! 🧮
🎯
Puzzle Time! Drag the code pieces below into the correct order to make a working calculator!
📝 Drag from here:
result = num1 + num2
num2 = int(input("Second number: "))
print("=== Calculator ===")
num1 = int(input("First number: "))
print("The answer is:", result)
🎯 Drop in correct order:
🎉
Amazing! You got it right! Now let's run your calculator!
6 Final Project: Age Calculator 🎂
🚀
Big Challenge: This program calculates how many days old you are! Run it and try it out!
💪
Extra Challenge: Can you add a line to calculate minutes? (Hint: multiply hours by 60!)
🎉 You're a Python Variable Master! 🎉
You've learned how to store information, do math, and get input. Keep practicing!