Hey, welcome back. It's Day 9 of 100 Days of Code.
And today we're going to be learning more about Python dictionaries
and nesting. And by the end of today,
you will have built a silent auction program.
We all know that there are auctions where everybody bids and you can see
everybody else's bid and the auctioneer gets you to bid higher and higher
values. Now there's also a type of auction called
a silent auction where everybody bids silently and no one knows the other
person's bids until at the very end of the auction where the highest bid is
revealed. That's what we're going to be building.
And if you wanna check out the final program,
then you can go to blind-auction-completed
.appbrewery.repl.run.
And here you'll not only see this amazing gavel built out of ASCII,
but also the secret auction program. So here's how it works:
let's say that I'm going to be the first person logging onto the program.
I'm going to give my name and my bid. Let's say
I'm going to bid a $53 for this item.
And once I'm done with my bid, it asked me whether
if there are any other bidders.
So if I type a yes then the screen clears and I can handover the laptop to
the next person who's going to make their bid. So let's say there's James
who's going to bid, um, even less than I did.
And then he's gonna make way for the final bidder who is going to bid $121.
So now at this stage, if everybody is done, then we type no,
and it's going to now tally up all the bids and figure out who bid the highest
and give us a winner, printing out 'The winner is Jenny
with a bid of $121.' There's a number of places that you could use this
if you are auctioning some piece of art or if you're trying to outbid your
brothers and sisters on who gets to go on the trampoline,
or if you're trying to start an auction with your friends or coworkers.
The silent auction has many, many uses. All right, in today's lessons,
we're going to be focusing mostly on the Python dictionary. But in addition,
we're also going to look at how we can nest say lists inside lists or
dictionaries inside dictionaries and also mixing lists and dictionaries as well.
Once you're ready,
head over to the next lesson and let's get started with the day.