Python Practice
Learn Python the way working code uses it: exact integer arithmetic for money, validation and control flow over raw records, dictionaries for grouping and aggregation, and the functions that compose into a report someone can trust.
Values, Control Flow & Collections
Learn how to do exact integer arithmetic, format numbers for display, branch and filter records with conditionals, and group and rank them with dictionaries.
Sale Amounts
Do the sales team's money arithmetic in integer cents: a line total, a whole-percent change rounded half-up, and a currency label with a thousands separator.
Clean the Records
Drop the test rows out of a raw sales export with a loop, and band each sale total as small, medium or large with if/elif/else at the defined boundaries.
Group by Product
Answer 'how much did each product and region sell?' with a dict built in one pass over the records, and rank the best seller by units with an alphabetical tie-break.
Monthly Sales Report
Turn a month of raw sale records into one report dict: validated counts, revenue and its label, average sale, revenue by region, the best seller, size-band counts and the change against the previous month.
Functions & Text
Learn how to split text with string methods, turn text into numbers safely, format values into fixed-width rows with default arguments, and compose small functions into one report.
Split the Log Line
Split one access-log line into its six fields as a tuple, ignoring stray spaces, upper-casing the method and returning None when the field count is wrong.
Read the Numbers
Read the log's text columns as numbers: digits to an int, a dash to zero, anything else to None, and a status code to its 2xx-5xx family or 'other'.
Human-Readable Sizes
Render byte counts as B, KB or MB labels rounded half-up, and build a padded label-and-value row whose width has a default.
Log Triage Report
Turn a batch of access-log lines into one triage report: malformed counts, status classes, methods, a total transfer label, a ranked path list and a padded table.
Custom Types
Learn how to write a class with its own methods, give it the behaviour Python expects when printing and comparing, let a dataclass generate that for you, and compose your own types into one report.
The Expense Record
Define an Expense class that stores a date, a category and an amount in cents, and answers which month it belongs to, how it reads as a money label and whether it falls in a given month.
Compare and Print
Define a Receipt class whose __repr__ prints both of its values and whose __eq__ makes two receipts with the same merchant and total equal while staying unequal to anything that is not a receipt.
The Budget
Define a Budget dataclass with a category, a limit in cents and a spending field that defaults to zero, and the methods that report what is left, whether the limit has been passed and the effect of spending more.
Expense Report
Compose the given expense, receipt and budget types into a monthly report that counts and totals one month's expenses, breaks them down by category, credits each budget with its own spending and names the largest expense.
Frequently asked questions
4>What will I practice in this path?
3 modules: Values, Control Flow & Collections, Functions & Text and Custom Types.
>How many challenges are there, and how hard are they?
12 challenges, all easy.
>What does this path run on?
Challenges run on Python 3.13.
>Do I need to install anything?
No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.
