Question: Write a function, get_rainfall, that tracks rainfall in a number of cities. Users of the function will enter the name of a city; if the
Write a function, get_rainfall, that tracks rainfall in a number of cities. Users of the function will enter the name of a city; if the city name is blank, then the function prints a report (as described below) before exiting. If the city name isn't blank, then the program should also ask the user how much rain has fallen in that city (typically measured in millimeters). After the user enters the quantity of rain, the program again asks them for a city name, rainfall amount, and so on - until the user presses Enter instead of typing the name of a city When the user enters a blank city name, the program exits - but first, it reports how much total rainfall there was in each city. Thus, if the user enters Boston 5 New York 7 Boston 5 [Enter, blank line) the program should output Boston: 10 New York: 7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
