Question: To practice summarizing data from a dictionary Degree of Difficulty: Moderate. Write a function called count_languages() which takes as parameter(s): A dictionary in the format
To practice summarizing data from a dictionary Degree of Difficulty: Moderate. Write a function called count_languages() which takes as parameter(s): A dictionary in the format of the city database as described in Q1 A list of neighbourhood names (as strings) This function should construct and return a dictionary where each key is a language (e.g. English or French, etc. . . ) and the value for that key is the number of neighbourhoods of that speak that language in a given list. For example, using the sample list of all of the neighbourhoods from "Ward 2" (see Q3 to see that list), the resulting dictionary should be: t { Sino - Tibetan languages : 2 , Chinese : 1 , Mandarin : 1 , Arabic : 1 , Bengali : 1 , French : 5 , English : 8 , German : 4 , Cree : 6 , Tagalog : 4 , Ukrainian : 5 , Spanish : 2 , Cantonese : 1} \.. Also, note that this function must not change the city database or the given list of neighbourhood names in any way.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
