Question: Python: Exercise 2: You are provided with a text file named covid19-3.txt. It reports a few confirmed cases of covid 19. It consists of three
Exercise 2: You are provided with a text file named covid19-3.txt. It reports a few confirmed cases of covid 19. It consists of three columns. The 1st column indicates the names of the provinces, the 2nd column indicates the names of the countries and the 3rd column indicates the numbers of confirmed cases. To do: 1. Define a function that reads, from covid19-3.txt, provinces, countries and confirmed cases in three separate lists. 2. Define a function that iterates through a list (or array) from the second element to the last and finds the smallest elements between them. 3. Define a function that sorts confirmed cases from largest to smallest. The sorted numbers must be returned by the function in a list or an array. The function should also return the names of the provinces in the order of confirmed cases. Note: 1. You have to design your functions yourself, including input and output parameters. 2. You need to manually check the preprogram result whether the sorting (confirmed cases and also provinces) is done correctly or not
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
