0 XP
Chapter 1
Variables & Values
Store information so your game can remember things.
Core Concept
Variables are like labelled boxes — they hold a value you can use later.
Theory
In Python, you create a variable by giving it a name and a value:
score = 0 # an integer
player_name = "Alex" # a string (text)
speed = 3.5 # a float (decimal)
alive = True # a boolean (True/False)
Variable names should be lowercase with underscores. Change the value anytime by reassigning it.
Live Demo — Run & Explore
Try it live
Loading...
Output will appear here…
Exercise 1 / 1
📝 Create a variable called `health` with value 100, and a variable called `level` with value 1. Then print both.
Your solution
Loading...
Output will appear here…
Ask AI Tutor
AI Tutorgemini-3.1-flash-lite-preview
AI
Hi! I'm your AI tutor for Variables & Values. 🎓
Ask me anything about this lesson — what a variable is, why loops are useful, or "why is my code not working?". I'm here to help you understand, not just give you answers!
What's on your mind? 😊