Python Basics Quick Reference
A compact beginner-friendly documentation sheet for common Python ideas.
Core ideas
Python uses indentation to define blocks. Keep code readable and consistent.
Variables do not need explicit type declarations in most cases.
Use functions to group repeated logic into reusable pieces.
Tiny examples
Print: print('Hello, world!')
Loop: for i in range(5):
print(i)
Condition: if score >= 50: print('Pass')
Good habits
Use meaningful names, add comments only when needed, and test small parts often.
Break big problems into small steps. That makes debugging much easier.
Common built-in types
Type Example Typical use
int 42 Counting and numbers(integers only)
str 'book' Text([“…”] & [‘….’] Both are acceptable)
list [1, 2, 3] Ordered collection
dict {'a': 1} Key-value data
Tip: save this as a reference while practicing small Python programs.