All Python Variable Examples
All Python Variable Examples
1. Integer
age = 18
print("Age:", age)
2. Float
price = 99.99
print("Price:", price)
3. String
print("Name:", name)
4. Boolean
is_student = True
5. List
print("Subjects:", subjects)
6. Tuple
print("Coordinates:", coordinates)
7. Dictionary
student = {
"name": "Advik",
"class": 12,
"age": 18
8. Set
unique_numbers = {1, 2, 3, 2, 1}
9. NoneType
data = None
print("Data:", data)
x, y, z = 10, 20, 30
print(x, y, z)
a = 5
b = 10
a, b = b, a
print("a:", a, "b:", b)
name = "Advik"
age = 18
a = 8
b = 2
print("Add:", a + b)
print("Divide:", a / b)
print("Power:", a ** b)