Day 009 of the 100 Days of Python challenge is a command-line Secret Auction. Multiple bidders enter names and bids, then the program determines the highest bidder after the auction closes.

Project Overview

Bids are stored in a dictionary with the bidder’s name as the key and the bid amount as the value:

bids[name] = price

A loop collects bidders until the user answers n when asked whether another bidder should continue. The input flow validates that names are not empty and contain letters, while bids must be positive whole numbers.

The find_highest_bidder() function loops over the dictionary, tracks the largest amount, and remembers the corresponding name. It also prints a sorted view of the submitted bids before displaying the winner.

What This Project Teaches

Day 009 provides practice with dictionaries, functions, loops, input validation, try and except, sorting values, and comparing data. It also demonstrates how a dictionary can associate two related pieces of information for each participant.

The project keeps the auction in memory, so the results disappear when the program exits. Adding file or database storage would be a natural next step.

Running the Project

cd 100daysofpython/day009
python main.py

The project imports its logo from the folder’s art.py file. View the Day 009 source code on GitHub.