1
00:00:00,570 --> 00:00:04,950
Hey, welcome back. It's Day 9 of 100 Days of Code.

2
00:00:05,700 --> 00:00:09,690
And today we're going to be learning more about Python dictionaries

3
00:00:09,780 --> 00:00:12,900
and nesting. And by the end of today,

4
00:00:13,140 --> 00:00:16,290
you will have built a silent auction program.

5
00:00:17,130 --> 00:00:20,460
We all know that there are auctions where everybody bids and you can see

6
00:00:20,460 --> 00:00:24,380
everybody else's bid and the auctioneer gets you to bid higher and higher

7
00:00:24,380 --> 00:00:27,770
values. Now there's also a type of auction called

8
00:00:27,800 --> 00:00:32,800
a silent auction where everybody bids silently and no one knows the other

9
00:00:32,990 --> 00:00:37,990
person's bids until at the very end of the auction where the highest bid is

10
00:00:38,510 --> 00:00:40,970
revealed. That's what we're going to be building.

11
00:00:41,420 --> 00:00:43,610
And if you wanna check out the final program,

12
00:00:43,640 --> 00:00:46,880
then you can go to blind-auction-completed

13
00:00:47,180 --> 00:00:48,830
.appbrewery.repl.run.

14
00:00:49,250 --> 00:00:53,480
And here you'll not only see this amazing gavel built out of ASCII,

15
00:00:53,810 --> 00:00:57,380
but also the secret auction program. So here's how it works:

16
00:00:57,740 --> 00:01:01,940
let's say that I'm going to be the first person logging onto the program.

17
00:01:02,300 --> 00:01:05,360
I'm going to give my name and my bid. Let's say

18
00:01:05,360 --> 00:01:08,840
I'm going to bid a $53 for this item.

19
00:01:09,440 --> 00:01:12,350
And once I'm done with my bid, it asked me whether

20
00:01:12,350 --> 00:01:13,790
if there are any other bidders.

21
00:01:13,880 --> 00:01:18,880
So if I type a yes then the screen clears and I can handover the laptop to

22
00:01:20,060 --> 00:01:24,770
the next person who's going to make their bid. So let's say there's James

23
00:01:24,770 --> 00:01:28,280
who's going to bid, um, even less than I did.

24
00:01:28,940 --> 00:01:33,940
And then he's gonna make way for the final bidder who is going to bid $121.

25
00:01:35,840 --> 00:01:39,920
So now at this stage, if everybody is done, then we type no,

26
00:01:40,550 --> 00:01:45,550
and it's going to now tally up all the bids and figure out who bid the highest

27
00:01:45,980 --> 00:01:49,340
and give us a winner, printing out 'The winner is Jenny

28
00:01:49,340 --> 00:01:54,020
with a bid of $121.' There's a number of places that you could use this

29
00:01:54,290 --> 00:01:58,160
if you are auctioning some piece of art or if you're trying to outbid your

30
00:01:58,160 --> 00:02:01,370
brothers and sisters on who gets to go on the trampoline,

31
00:02:01,880 --> 00:02:05,060
or if you're trying to start an auction with your friends or coworkers.

32
00:02:05,660 --> 00:02:10,039
The silent auction has many, many uses. All right, in today's lessons,

33
00:02:10,039 --> 00:02:14,540
we're going to be focusing mostly on the Python dictionary. But in addition,

34
00:02:14,540 --> 00:02:19,370
we're also going to look at how we can nest say lists inside lists or

35
00:02:19,370 --> 00:02:23,720
dictionaries inside dictionaries and also mixing lists and dictionaries as well.

36
00:02:24,440 --> 00:02:25,273
Once you're ready,

37
00:02:25,280 --> 00:02:28,400
head over to the next lesson and let's get started with the day.

