
Python is dynamically typed — you don't declare types, Python infers them.
Basic types:
name = "Alice" # str age = 30 # int height = 5.9 # float is_student = True # bool nothing = None # NoneType
Check the type:
type(age) # <class 'int'>
Type conversion:
int("42") # 42
str(100) # "100"
float("3.14") # 3.14
bool(0) # FalseNaming rules: lowercase_with_underscores (snake_case). No spaces. Can't start with a number. Case-sensitive.
Constants: By convention, use ALL_CAPS: MAX_SIZE = 100. Python doesn't enforce immutability, it's just a signal.
Reference:
TaskLoco™ — The Sticky Note GOAT