Question: Using Python, thank you. Define a function named print_covid_by_month(countries_cases_dict, month_list) which takes a dictionary and a list of months as parameters. The function prints country

Using Python, thank you.
Define a function named print_covid_by_month(countries_cases_dict, month_list) which takes a dictionary and a list of months as parameters. The function prints country names and covid19 cases by month. The function should print each country's Covid19 cases for the corresponding month in descending order of number of cases (i.e. the country with the highest cases is printed first). For example, consider the following: a_dict = {'Finland': [1815, 654], 'Australia': [1393, 9367]} month_list = ['Sep', 'Aug'] The month list contains two elements only. Hence, the function would print two sets of data. Since the number of cases for Australia is bigger than the number of cases in NewZealand, the function would print the number of cases and country name for Australia first. Sep: 1815 Finland 1393 Australia Aug : 9367 Australia 654 Finland For example: Test Result a_dict = {'Finland': [8419, 6018, 1815, 654], 'Australia': [311, 519, 1393, 9367]} Nov : month_list = ['Nov', 'Oct', 'Sep', 'Aug'] 8419 Finland print_covid_by_month(a_dict, month_list) 311 Australia Oct : 6018 Finland 519 Australia Sep : 1815 Finland 1393 Australia Aug: 9367 Australia 654 Finland
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
