Writing Idiomatic Python
Bridge the gap between working code and clean, Pythonic engineering. Learn to write expressive data transforms, robust object models, memory-efficient streams, and reusable decorators.
Like Duolingo, but for Writing Idiomatic Python. Tomo turns the whole topic into a game you play five minutes a day, until it actually sticks.
26 levels across 4 sections, about 52 minutes end to end, roughly 10 days at five minutes a day. It moves through Writing Expressive Code, Structuring Data and Objects, Controlling Execution Flow, and Understanding the Runtime. It assumes you already know the basics.
Free forever · No credit card · iPhone & Android

Key ideas in Writing Idiomatic Python
- Square brackets produce a list comprehension preserving order and duplicate items.
- Braces without a colon construct a set comprehension that discards duplicates.
- Braces with a colon construct a dictionary comprehension from paired elements.
- A trailing if clause filters items before passing them to the output expression.
- A leading if-else ternary expression transforms each item without changing list length.
- Comprehension trailing filters discard non-matching items without requiring an else.
- The walrus operator := assigns an expression to a name inside an inline condition.
- Binding in the filter clause lets the leading expression reuse the result for free.
- Assignment expressions avoid calling expensive functions twice per iteration.
- Nested comprehension for clauses read in the same outer-to-inner order as loops.
- The outer iterable loop must appear before the inner collection variable it unpacks.
- Optional filter clauses evaluate after the innermost loop clause they constrain.
- A starred variable in Python unpacking always absorbs surplus items into a list.
- Python permits only one starred expression per assignment target.
- Unstarred targets at both ends capture exactly one item before and after the star.
- Loop variable targets mirror the nested tuple or list layout of each yielded item.
You've tried the other tabs
Thirty open tabs. Four facts you actually kept.
You watched. You nodded. By Sunday it was gone.
One answer, then back to scrolling.
Eight weeks. You meant to finish. You didn't.
Tomo gives Writing Idiomatic Python the Duolingo treatment: levels, streaks, and quick quizzes that test what you just learned. That game loop is what the tabs above never had, so it's the one you actually finish.
Here's what playing it feels like
A real question from this course. Take your best guess.
What happens when you use curly braces without a colon in `{x for x in items}`?
Get it right to open this lesson and 25 more in the app.
How to learn Writing Idiomatic Python, step by step
Go in order. 26 short levels across 4 sections, about 52 minutes in all, five minutes a day.
- 1
Writing Expressive Code
- Data Transformations with Comprehensions
- Structural Unpacking and Pattern Matching
- Specialized Collections from the Standard Library
- 2
Structuring Data and Objects
- Modern Class Design with Dataclasses and Dunders
- Attribute Access and Encapsulation
- 3
Controlling Execution Flow
- Memory-Efficient Streaming with Generators
- Deterministic Cleanup with Context Managers
- Metaprogramming with Function Decorators
- 4
Understanding the Runtime
- The Object Model, Scopes, and Memory
4 sections · 9 units · 26 levels. Built to play, not to enroll.
Questions about Writing Idiomatic Python
How do I learn Writing Idiomatic Python?
Go in order: start with Writing Expressive Code, then Structuring Data and Objects, then Controlling Execution Flow, then Understanding the Runtime. On Tomo that's 26 short levels, about 52 minutes in all, played five minutes a day. Start free and play the first level in under a minute.
Is there a Duolingo-style app for Writing Idiomatic Python?
Yes. Tomo works like Duolingo: short daily lessons, streaks and quick quizzes. Writing Idiomatic Python is one of its free courses, and you can type any other topic to get a course of your own.
Is the Writing Idiomatic Python course free?
Yes. Writing Idiomatic Python is playable on Tomo's free plan, which doesn't expire. No credit card, no waitlist. Download the app and start your first lesson.
How long does it take to learn Writing Idiomatic Python?
26 levels across 4 sections, about 52 minutes of play in total. It's built for five minutes a day, so you finish it a little at a time instead of all at once.
Do I need any background to start Writing Idiomatic Python?
No. It's pitched at an intermediate level, so it starts where you are and builds up. If you can tap a phone, you can start.
Tomo is in ChatGPT
Tomo is also a ChatGPT plugin: the same playable courses, built and played inside your chat.
Add Tomo to ChatGPT- What to ask
- “Make me a Tomo course on black holes.” “Turn this chat into a Tomo course.”
- What you get
- Quick questions with instant feedback, hearts and stars, ready to play in about a minute.
- Where it goes
- No sign-up to start. Connect your Tomo account and your streak carries on in the app.
You pick the voice
Writing Idiomatic Python is taught in the Explain Like I'm 5 style: no big words. promise.. Want a different feel? In the app you can spin up the same topic in any of Tomo's teaching styles. Same facts, totally different vibe.
More Technology on Tomo
Writing Idiomatic Python
Transform clunky, procedural script code into elegant, maintainable Python. Master lazy evaluation, function ergonomics, context managers, and the native data model.
Python in Practice
Bridge the gap between basic syntax and professional Python. Learn to write clean, idiomatic code while dodging common traps in memory, mutability, and error handling.
C++: Foundations and Pitfalls
Build a robust mental model of C++ from your first program to complex systems. Uncover the subtle language traps and memory quirks that catch even experienced programmers.
C++: Code, Memory, and Control
Learn how C++ bridges human-readable logic and direct hardware control. Write and compile your first programs, manipulate dynamic data collections, and understand how memory references keep your software fast and crash-free.
Writing Your First Python Scripts
Build a working intuition for the world's most popular programming language. Learn how Python stores information, makes decisions, and automates repetitive tasks with clean, readable code.
Writing Code with Python
Turn plain text into working programs that calculate, automate, and solve real problems. Learn how to direct computer logic, work with collections of data, and build reusable scripts.
Start Writing Idiomatic Python today.
Download Tomo, search Writing Idiomatic Python, and play your first lesson in under a minute.