π« Variables
A container for value (String, Intiger, float, boolean, etc).
variables.py
# String
name = "John Doe"
print(name)
print(f"Hello, {name}!") # Formatted string | f-string
# Integer
age = 30
print(age)
# Float
height = 5.9
print(height)
# Boolean
is_student = True
print(is_student)π Variable Naming Rules:
- Must begin with a letter (a-z, A-Z) or an underscore ( _ )
- Can contain letters, numbers, and underscores
- Case-sensitive: Name and name are different
Last updated on