Want to work through exercises focused on a specific topic? Start an exercise path!
An Exercise Path is a series of exercises focused around a specific topic. When you've selected an exercise path, you'll start recieving recommendations for exercises in that path instead of the exercises from your chosen skill level. Once you've worked through a path, you'll continue receiving exercises from your skill level (currently ).
Just click the Start Path button to select the path you'd like. You can always change the path you're in or deactivate your activate path later.
Pick a path to find out more about it:
You'll start with a few exercises that could be iterator/generator-powered, but don't necessarily need to be.
This path mostly focuses on getting generator function and generator expression practice, but you'll probably need to write at least one iterator class along the way as well.
This path is recommended for novice-level users or intermediate-level users who are new to generators.
In this path you'll get practice making command-line interfaces, processing text files, and working with the standard input and standard output file streams.
If you've never processed text files before or made command-line interfaces, this path may be a challenge, but it's one you'll want to start with.
This is an fast-paced introduction to classes for advanced beginners.
In this path you'll practice working with methods, instance attributes, class-level attributes, properties, inheritance, string representations, comparison operators, data classes, and a couple "dunder methods" you probably haven't thought to create before.
This path is recommended for novice-to-intermediate users who have some experience with Python classes already and want to practice their skills.
This path will introduce you to the notion of first-class functions and eventually to decorator functions.
The first exercise involves passing functions as arguments. The next exercise involves defining a function within another function. After that you'll receive 2 exercises that require making your own decorators.
This path is recommended for novice-level users
In this path you'll get practice with operator overloading and inheritance.
You'll make classes that act as iterables, mappings, and sequences and you'll also make a class mixin (for use with multiple inheritance).
You'll need to take the "Diving Into Classes" path before this one.
Get practice making dictionary-like, set-like, and list-like classes.
In these exercises you'll make more of these custom collections than you'll likely ever need to write in your own code.
Do the "Deeper into Classes" path before this one (one of the exercises in that path is a prerequisite for that's in this one).
These 2 exercises should give you a taste for what descriptors are and how they work.
You probably won't ever need to create descriptors yourself in Python, but it's nice to know about them (classmethod, staticmethod, property, and the method calling syntax in Python are all descriptor-powered).
This path is for you if you've made command-line interfaces, you how to navigate the file system, and you've worked with binary data files before, but you just want more practice with it all.
The "More CLIs and file manipulation" path is recommended before this one.
The 3 exercises in this path all involve considering the time complexities involved with the data structures you're using.
Should you use a list, a set, a dictionary, or some combination of the three? And are there any tools in the standard library to help you accomplish your goal in a time-efficient way?
Want more descriptor practice than you'll ever need? Work through the Intro to Descriptors path and then do this one.
The 3 exercises here go deeper into descriptors than you'll likely ever need to go. You'll also get a bit of practice with attribute lookups, memory management (important in descriptor land sometimes), and inheritance.
Want to learn about metaclasses by making your own? Try these 2 exercises out. These exercises aren't easy, but it's hard to find a realistic metaclass example that is easy.
If you don't know what metaclasses are, you probably don't need to know what they are. Unless you're implementing a framework for other people to write code with (like Django) you probably shouldn't even use this magic in your own code.
This exercises involve could benefit from Python 3.10 features (namely features I mentioned in my article on Python 3.10).
All of these exercises are somewhat advanced, so I don't recommend this exercise path for novice users.