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…

Loops