
Python strings
Strings never change in place: every method returns a new string, so keep the result (s = s.strip()).
15 topics, each on a single A4 page you can print, pin above your desk or keep open next to your editor. 904 examples in all, and every one is run against Python 3.13 before a sheet is published, so the result printed next to it is the result you'll get. Each sheet ends with the mistakes people actually make.

Strings never change in place: every method returns a new string, so keep the result (s = s.strip()).

Lists change in place: append(), sort() and friends edit the list and return None, so don't assign their result.

A tuple is a list that can't change, which is what lets it be a dict key.

A dict maps unique, hashable keys to values: lookup by key is fast, and keys stay in the order you added them.

A set holds each value once, in no particular order, and answers x in s instantly.

seq[start:stop:step] makes a new sequence from a run of items: start is included, stop is excluded, and any of the three can be left out.

A comprehension is a for loop that builds a new collection: read [n * 2 for n in nums if n > 0] as "for each n in nums, if n > 0, keep n * 2".

Anything in {} is run as Python and turned into text; after a colon comes the format spec, {value:fill align sign width , .precision type}.

A Path is only a name until you read or write it, and text files should always be opened with encoding="utf-8".

An error travels up through the calls until an except that matches its class catches it, so catch the narrowest class you can actually handle.

A date is a day, a datetime is a day plus a clock time, and a timedelta is a length of time: subtract two datetimes and you get one.

A pattern describes text; re finds it, splits on it or replaces it.

Every tool here is lazy: it hands out one item at a time and is used up after one pass, so the examples wrap it in list() to show what it yields.

Hints are labels for readers and tools: Python stores them but never checks them, a checker such as mypy or pyright does.

argparse turns the words typed after your script's name into an object of typed values, and writes the help and error messages for you.
Free to share, not to sell. Print them for yourself, your class or your team, and share the files as they are. Each sheet links to its runnable version on this site, where you can try every example in the browser.