Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 FinlandStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started