https://app.dataquest.io/m/314/dictionaries-and-frequency-tables/10/looping-over-dictionaries
I have not been able to understand the answer provided for question no 3? It’ll be great ! if some one can help.
Thanks a lot!
https://app.dataquest.io/m/314/dictionaries-and-frequency-tables/10/looping-over-dictionaries
I have not been able to understand the answer provided for question no 3? It’ll be great ! if some one can help.
Thanks a lot!
Hi deepaknegi0,
Do you mean this?
percentage_15_allowed = content_ratings['4+'] + content_ratings['9+'] + content_ratings['12+']
Were you able to come up with your own answer?
I mean to say, I haven’t understood the answer given in the section and it doesn’t make much sense to me.
How did you solve it?
Haven’t solved it yet.
So the question is this:
- Find out the percentage of apps that can be downloaded by a 15-year-old. Assign your answer to a variable named
percentage_15_allowed
.
Which apps are a 15-year-old allowed to download? The ones rated 4+
, 9+
and 12+
are all okay. Apps rated 17+
are not okay.
All you have to do then is sum the values in the content_ratings
dictionary that correspond to the keys of the allowed ratings.
Alternatively, knowing that the percentages for the different ratings sum 100, you can just subtract the 17+
category from this value.