From a problem to a program
You already know the tools: variables, conditions, loops, functions, classes, files, exceptions... A project consists of…
Put everything you have learned into practice with complete projects. In this lesson you will learn how to go from a problem to a program, how to organise code into functions, classes and modules, and how to build small applications: a contact book, a log analyzer, an expense tracker, an inventory control, a data validator, a game, a unit converter and a test bench.
You already know the tools: variables, conditions, loops, functions, classes, files, exceptions... A project consists of…
We are going to build a contact book bit by bit, the way a programmer would: first the minimum that works and then we add pieces…
When a program grows, the way you organise it matters as much as what it does. These practices save you time and errors, and make…
Create a Python program that manages a contact book stored in a dictionary (name → phone). It is the first mini-project: organise…
Create a Python program that analyses an application log using regular expressions and counters, and shows a summary.
Create a Python program that manages a list of expenses using an enumeration for the categories and a dataclass for each expense.
Create a Python program that controls a shop inventory with its own class and a custom exception for insufficient stock.
Create a Python program that reads CSV data, validates each row and exports the valid ones to JSON , reporting the errors.
Create a Python program that simulates a number guessing game. To make it testable, the secret number and the guesses are read…
Create a Python program that converts units of length, mass and temperature using factor tables in dictionaries and a conversion…
Create a Python program that works as a mini test bench : define three functions and automatically check a list of test cases.
Program the move of an automatic player in tic-tac-toe . The strategy is simple but effective: win if it can, block if the…
A bank with classes ( Account and Bank ) and its own exception hierarchy : each possible error is a subclass of a base error, and…
Manage a library's loans by storing the books in an in-memory SQLite database. Use queries with parameters ( ? ), do not…
An adventure game is represented with data: a dictionary of rooms with their exits and another with the objects of each room. The…
Build a converter from a subset of Markdown to HTML combining line-by-line reading, state and regular expressions.
A real calculator does not use eval : it parses the expression. Split the text into tokens and write one function per precedence…
A to-do list that persists in a JSON file: at the start it loads the file if it exists and at the end it saves it.
Conway's game of life is a cellular automaton: each cell is alive or dead and its state in the next generation depends only on…