SRS Badger

Python: everyday idioms

3 chapters · 11 problems

An example course: small Python problems built around the idioms you reach for every day (slicing, comprehensions, zip, enumerate, sets and the built-ins). Each one is a few minutes of real code, checked by tests.

The point isn't to finish it. Switch on a chapter, let the reviews come back, and notice which ones you can still write cold a month from now. Then make cards like these for the things you keep looking up.

What's inside

  1. Strings and lists
    4 problems

    Slicing, splitting and joining. Most of these are one line once you know the idiom, which is exactly why they're easy to forget.

  2. Comprehensions and built-ins
    6 problems

    The parts of Python that replace loops. If you find yourself writing result = [] and append, there's probably a one-liner here.

  3. Classic algorithms
    1 problem

    Short problems that come up again and again, in interviews and in real code. Each has a neat solution worth knowing by heart.