Blog

Python Cheat Sheet: Quick Reference for Working Developers

The Python syntax, data types, and library patterns that come up all the time. One page, printable.

Why a cheat sheet

Python reads like pseudocode until it doesn't. You'll remember for x in list just fine, but six months from now you'll blank on whether it's dict.items() or dict.entries(), or how *args and **kwargs unpack. I still look up string formatting every time.

A cheat sheet is the thing you tape to your monitor so you stop opening the same Stack Overflow tab.

What's on it

The RefMint Python 3 cheat sheet starts with variables and types, moves through control flow and data structures, and ends with practical library patterns for pandas, requests, csv, and json. Two pages, letter landscape, meant for printing.

The stuff you'll look up most

Reading a CSV into a dataframe. You know the syntax, you just can't type it from memory:

import pandas as pd

df = pd.read_csv("data.csv")
print(df.head())
print(df.describe())

Same with making an API call. You've done it a hundred times, and you'll still second-guess the response method:

import requests

resp = requests.get("https://api.example.com/data")
data = resp.json()

Neither of these is hard. But when you're in the middle of something else, having them on paper means you don't lose your train of thought.

Get the PDF

Grab the Python 3 cheat sheet as a print-ready PDF or Markdown file.