Basic Python Programming Cheatsheet
Quick reference for Python syntax and functions.
Variables & Data Types
x = 10
name = 'Alice'
pi = 3.14
Control Flow
if x > 5:
print('x is greater than 5')
else:
print('x is 5 or less')
Loops
for i in range(5):
print(i)
Functions
def greet(name):
return f'Hello, {name}'