Question: Write a function called ReservoirInfo which takes information about reservoir storage as the inputs and outputs a statement: 'In [Month Name], [Reservoir Name] held

Write a function called ReservoirInfo which takes information about reservoir storage as the inputs and

Write a function called ReservoirInfo which takes information about reservoir storage as the inputs and outputs a statement: 'In [Month Name], [Reservoir Name] held [Volume] acre-feet of water.' where the words in brackets are the name of the input month, reservoir name, and storage volume, respectively. The function arguments should be: name : reservoir's name as a string, exactly as it appears in reservoir_names month : integer representing the month number, where 1 corresponds to January, 2 corresponds to February, etc. Be careful with your string formatting. Any small modification, such as extra space or character, will result in a failed test. You should name the function arguments name and month. An example function call and its output are: >>>ReservoirInfo(name = 'Lake Oroville', month= 1) 'In January, Lake Oroville held 1642000 acre-feet of water.' Important notes: . Your function should return the statement [Month Name] should be the full month name of the input number. You may find the calendar.month_name[number]. attribute helpful. To use it, you have to import the module calendar first. [Volume] should be obtained from reservoir_data based on the corresponding input month and reservoir name. You may find the list index() method helpful (returns the index of the specified element in the list). Note that [Volume] should be an integer and not float. Activate Windows

Step by Step Solution

3.29 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Python function called ReservoirInfo that takes the reservoirs name and the month as input p... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!