💡 What You'll Learn
Variables are like labeled boxes that store information. You give them a name, then put data inside.
Use = to put a value in a variable. Later, you can use the variable name to get that value back!
variables.py
1name = "Alex"
2age = 12
3print("Hi, I am", name)
4print("I am", age, "years old")
📺
Output
Click "Run Code" to see the result!
🎯 Your Challenges
1
Your Info
Change the name and age to your own information!
2
Add a Pet
Create a variable called "pet" with your pet's name (or "None" if no pet)
3
Mix It Up
Create two variables and print them together: "My favorite is X and Y"
📚 What You Learned
- Variables store data with a name you choose
- Use
=to assign a value to a variable - Variable names should describe what they store
- You can print variables alongside regular text