Paths

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 exercises from that path instead of exercises from your chosen skill level. Once you've received all the exercises in your active path, you'll go back to receiving exercises from your skill level ().

If a path includes exercises you've already been assigned, you'll only receive exercises in that path that are new to you (you'll will not be assigned the same exercise twice).

Just click the Start Path button to select the path you'd like. You can change the path you're in or deactivate your activate path later.

Pick a path to find out more about it:

  1. Intro to Generators and Iterators
  2. Introduction to CLIs and file manipulation
  3. Diving Into Classes
  4. Introduction to first-class functions and decorators
  5. Deeper Into Classes (with dunder methods)
  6. Context Managers
  7. Intermediate CLIs and file manipulation
  8. Custom Collection Practice
  9. Intro to Descriptors
  10. Advanced CLIs and file processing
  11. Time Complexity Practice
  12. Even More Descriptors
  13. Intro to Metaclasses
Intro to Generators and Iterators

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.

Exercises included
with_previous
uniques_only
lstrip
RandomLooper
chunked
loop_tracker
strict_zip
Introduction to CLIs and file manipulation

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.

Exercises included
unsmart.py
phonetic.py
tee.py
passphrase
Diving Into Classes

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.

Exercises included
Circle
Point
Month
NextDate
float_range
BankAccount
Introduction to first-class functions and decorators

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

Exercises included
natural_sort
partial
count_calls
coalesce
Deeper Into Classes (with dunder methods)

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.

Exercises included
EasyDict
Unpacker
FieldTracker
ProxyDict
Circle (revisited)
ReverseView
Context Managers

This path will introduce you to defining and using context managers.

This path is recommended for intermediate-level users.

Exercises included
suppress
make_file
cd
Timer
warningutils
Intermediate CLIs and file manipulation

This path includes practice with file encodings and processing binary data files.

The "Introduction to CLIs and file manipulation" path is recommended before this one.

Exercises included
iconv.py
grep
checksum
gz
Custom Collection Practice

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).

Exercises included
PermaDict
CyclicList
SequenceZip
Grouper
OrderedSet
OrderedSet (revisited)
ProxyDict (revisited)
Intro to Descriptors

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).

Exercises included
alias
class_property
Advanced CLIs and file processing

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.

Exercises included
format_fixed_width
last_lines
find_duplicates
count_lines
lines2.py
dups.py
crossword helper
split
Time Complexity Practice

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?

Exercises included
MinHeap
SortedList
OrderedDict
Even More Descriptors

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.

Exercises included
validators
cached_property
computed_property
Intro to Metaclasses

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.

Exercises included
final_class
NoMethodCollisions