Services Work Learn About Contact
0/10
Lesson 2 of 10

Variables & Data Types

In Python, you create a variable by writing a name and assigning a value with =. You do not need to declare the type — Python figures it out automatically.

Common types: int (whole numbers), float (decimals), str (text), bool (True/False).

PYTHON
name = "Ali"        # string
age = 25            # integer
price = 19.99       # float
is_active = True    # boolean

print(type(name))   # <class 'str'>
print(type(age))    # <class 'int'>
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed Python!

You finished all 10 lessons and quizzes. You now know the basics of Python.