Free Online Code Editor
Store and manipulate data using variables.
# Variables in Python
name = "Alice"
age = 25
height = 5.6
is_student = True
print(f"Name: {name}")
print(f"Age: {age}")
print(f"Height: {height}")
print(f"Student: {is_student}")
# Variable types
print(f"\nType of name: {type(name)}")
print(f"Type of age: {type(age)}")Python variables don't need type declarations. The type is inferred from the value. Use f-strings for string formatting.