A variable stores data in memory. You donβt need to declare its type in Python.
a = 10
b = "Python"
c = 3.14
| Type | Example |
|---|---|
| Integer | 10, -5 |
| Float | 3.5, 7.89 |
| String | "hello" |
| Boolean | True, False |
| None | Represents null |
int("10")
float("3.14")
str(100)
name = input("Enter name: ")
print(name)
Variables act as the building blocks of all computations. Next, we cover control flow.
Take quizzes related to this topic and see where you stand!
Start Quiz Now