Side Projects
These optional projects let you put your Python skills into practice and earn extra credit. Each successfully completed project adds 0.25 points to your final exam grade, up to a maximum bonus of 0.75 points across three projects. The bonus is added before the final exam grade is capped at 10.
You can complete as many projects as you like, but only three count towards the bonus. More projects will be added in later modules, so keep an eye out!
What to submit
Upload your completed notebook to the Side Projects section on Blackboard before the final exam.
Submit a Jupyter notebook (.ipynb) containing your code, saved outputs, and explanations. Your notebook should work as a diary of how you solved the problem. Include:
- Your approach and the main intermediate steps.
- Tests you used to check your functions, including expected and actual results.
- Problems you encountered and how you corrected them.
- The final result and a short explanation of what it shows.
You do not need to keep every unsuccessful attempt. Select the steps that help explain your reasoning. Use Markdown cells for explanations and code comments where they help the reader understand your choices.
Before submitting, restart the kernel and run all cells in order. Make sure the notebook works from start to finish and that its outputs are saved. Include any additional files needed to run it.
Using AI tools
These projects are meant to be challenging. You may use AI tools to help you, but you must understand the code you submit. If you use AI, briefly explain how you used it and how you checked its suggestions.
You may be asked to explain your work during office hours, including how your functions work and why you chose your approach.
Complete all numbered steps in your chosen project. Stretch goals are optional extensions for further practice.
Recommendation System
How can a shop suggest a product you might like? Build a simple recommendation system that compares a customer’s purchases with those of other customers. Use shared purchases to identify relevant customers, then recommend the most frequent products the customer has not bought yet.
Main concepts: tuples, sets, dictionaries, loops, and frequency counts.
Traveling Salesman Problem
Find the shortest route that visits each city exactly once and returns to its starting point. You will build a brute-force solver that checks every possible route for a small set of cities. You will see this problem again in Optimization next year, so this is a chance to get a head start!
Main concepts: coordinates, distances, permutations, and breaking a problem into functions. Generating permutations introduces a more challenging recursive task.
Parrondo’s Paradox
Can switching between two losing games produce a winning outcome? Simulate two games, plot how your balance changes, and investigate why the order in which you play them matters.
I have a soft spot for this project: Professor Parrondo taught at the Complutense University of Madrid when I was a student there.
Main concepts: random numbers, functions as arguments, simulation, and parity.
Sudoku Solver
Build a solver for standard 9 × 9 Sudoku puzzles. You will check possible placements and use backtracking to undo choices when they lead to a dead end. This project introduces recursion and takes some patience, but the guide breaks the process into manageable steps.
Main concepts: nested lists, mutation, recursion, and backtracking.
Ticket Booking System
Build a booking system for the Olympic Games. Fans view the seating plan of each venue, book seats, and cancel them, all through a numbered menu. Every booking must reserve the right seat, and every cancellation must free it again.
Main concepts: tuples, nested lists, string formatting, updating lists in place, and input validation.
Battleship
Write the logic behind a two-player Battleship game: record shots, detect hits and sunk ships, and decide when the fleet is gone. A supplied interface turns your functions into a playable game in Jupyter or Google Colab.
Main concepts: tuples, sets, nested dictionaries, copying, and functions that build on each other.