Adaptive Lesson

The difficulty adapts to your mastery in real time.

AI-generated
Prof. Ada Logic
+120 XP
Python Fundamentals: Variables & Data Types
Objective: Understand how Python stores values in variables and how its core data types behave so you can predict program output.
Lesson progress60%
x

A variable is a named reference to a value stored in memory. In Python you don't declare a type — the interpreter infers it from the value you assign.

The core built-in types are int, float, str, bool, list, dict, tuple, and set. Each behaves differently when you operate on it. Knowing which type you're holding lets you predict what an operation will do.

Mutability matters: lists and dicts can change in place, while strings and tuples cannot. This single distinction explains a surprising number of bugs.

Interactive Example
score = 95          # int
name = "Ada"        # str
passed = score >= 60  # bool -> True
grades = [95, 88]     # list (mutable)
grades.append(72)     # [95, 88, 72]

Try predicting the type of each variable before running it — that habit is what mastery looks like.

Take Challenge

Difficulty

Current difficulty: Medium

Mastery score72%
x

Reach 85% to unlock Mastery difficulty and the next mission.

Ask AI Teacher

Stuck? Prof. Ada Logic will guide you with hints and questions.

Open tutor chat
Recommended

Next: Control Flow & Loops

PathFinder AI suggests this once you pass the challenge.