Languages

Python 3 Cheat Sheet

Print-ready cheat sheet for Python 3, organized for fast lookup, study, and desk-side use

Source
Official Python documentation (docs.python.org)
License
MIT
Updated
2026-03-27

Sample

What's in this cheat sheet

  • Basics
  • Strings
  • Lists
  • Tuples & Sets
  • Dictionaries
  • Control Flow
  • Loops
  • Functions
  • Classes
  • Error Handling
  • File I/O
  • CSV
  • JSON
  • HTTP Requests
  • pandas Basics
  • Useful Built-ins
  • Modules

Variables

name = "Alice"   # str
age = 20         # int
gpa = 3.85       # float
active = True    # bool

Data Types

strText: `"hello"`
intInteger: `42`
floatDecimal: `3.14`
bool`True` / `False`
listOrdered, mutable: `[1, 2, 3]`
tupleOrdered, immutable: `(1, 2)`
dictKey-value: `{"a": 1}`
setUnique items: `{1, 2, 3}`

Arithmetic

+ - *Add, subtract, multiply
/Division (float): 7/2 → 3.5
//Floor division: 7//2 → 3
%Modulo: 7%2 → 1
**Power: 2**3 → 8

Download the full cheat sheet for all sections, formatted for print

Download PDF

Downloads

Choose the treatment that matches how you read