So, let's go over some questions.
So, this is a true false boolean.
So, true false a dictionary is an unordered collection of key value pairs,
that is absolutely true.
That is what a dictionary is.
Then we have a multiple choice.
What's printed by the following statement.
So, here we declare a dictionary with three key value pairs cat, dog, elephant.
And then we print out my dictionary sub dog.
So, the value of this expression is,
whatever value is associated with the key dog in my dictionary.
So, in order to answer this question,
we have to look at what's associated with this key dog.
We find the key value pair for dog here,
and we see that the value associated with the key dog is six.
So, we should expect six to be printed out.
Then this question asks us to create
a dictionary that keeps track of the USA's Olympic medal count.
Each key of the dictionary should be the type of metal;
so gold, silver or bronze,
and each key's value should be the number of that type of metal that the USA has won.
So currently, the US has 33 gold,
17 silver and 12 bronze.
So again, the keys here should be gold, silver and bronze,
and the values associated with those keys should be
the number of the medal that the US has won.
Then they want us to create that dictionary and save it in the variable medals.
So in the code,
I'm going to say medals equals a dictionary.
So, I'll use curly braces,
and first I want to have the key gold associated with the value 33.
If I just typed gold 33 which is common to do,
then I would actually get an air,
because when I say gold it's looking for your variable called gold.
Instead I want to make this key a string.
So, I want the string gold to be associated with the value integer 33.
Same thing with silver.
So, silver is associated with the value 17,
and bronze is associated with the value 12.
So, here I just got each of these.
So, 12,17 and 33 from the problem statement.
So, now when I run my code,
then I should see that it parses.
So, this question is very similar.
Here we are told you're keeping track of Olympic medals
for Italy in the 2016 Rio Summer Olympics.
At the moment Italy has seven gold,
eight silver and six bronze metals.
Create a dictionary called Olympics where the keys are the type of
medal and the values are the number of that type of medal that Italy has won so far.
So, exact same idea,
I'm going to say Olympics equals,
and then we want to assign that to be a dictionary,
so, we use curly braces.
We have three key-value pairs.
So, we have gold associated with the value seven,
then just for the sake of writing this out slightly differently,
I'm going to set silver on the next line by saying Olympics sub silver equals eight.
So, this is going to add a new key value pair associating silver with the value eight.
And then I need to also say Olympics sub bronze equals six.
So, here I just did something slightly different,
I could have added three value pairs right in here like I did for the previous problem,
but I could also just set the key value pairs using
an assignment statement like I did on lines two or on lines three.
Again, the keys are all strings,
so here I'm using double quotes to create the string,
here I'm using single quotes,
but the effect is that we have three key-value pairs,
all the keys are strings.
So, gold, silver and bronze.
All the values are integers seven, eight and six.
That's all for now until next time.