Lesson 4 of 55
PythonVariables and Data Types
20 minutes
Course progress7%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 4 of 55
Python20 minutes
Keep these ideas in mind as you work through the lesson.
Python uses dynamic typing, which means you don’t need to declare a variable’s type upfront – the interpreter infers it from the assigned value. Common built‑in types include integers, floats, strings, booleans, and the special None value.
age = 30 # int
price = 19.99 # float
name = 'Alice' # str
is_active = True # bool
nothing = None # NoneType
print(type(age), type(price), type(name), type(is_active), type(nothing))
user_name).class, def, if).With variables under your belt, you can start storing and manipulating data.