L1·Foundations
📦Variables & Types
Names bound to objects in memory.
basicsassignmentintstrfloat
§ 1What is a variable?
A variable is a name that refers to an object stored in memory. Python doesn't have 'boxes' holding values — it has labels pointing to objects.
§ 2Assignment
The = operator binds a name on the left to the object on the right. The same name can be re-bound to any type later.
1x = 422x = "hello" # perfectly legal — Python is dynamically typed§ 3Built-in types
int (whole numbers), float (decimals), str (text), bool (True/False), NoneType (None). Use type(x) to inspect.
Worked example
1name = "Ada"2age = 363height = 1.724is_engineer = True5print(name, age, height, is_engineer)Try it live · Python runs in your browser
Loading playground…
ChallengeCreate three variables of different types and print their type().
Checkpoint quiz
Question 1 / 3
What does type(3.14) return?
Lesson test
Take an 8-question test on “Variables & Types” — concepts, output prediction, bug spotting and interview questions.