e problem areas based on the elevations in various regions and the expected rise of the nearby river after severe weather. Given a two-dimensional list/table representing a grid-layout map of elevations of different regions in the area, ask the user for a predicted elevation rise in the river water and show the problem areas by replacing the elevation for that area with an asterisk (*) to indicate that the area would be completely under water with the given river rise (e.g., if the region elevation is 200 or less and the river rise is 200 then that region would be completely submerged). You should not create a new list for this but replace the appropriate elevations in the original list with asterisks. Your code should use a method called printList to print the resulting representation of the map as shown in the sample output where the asterisks are printed as they occur but the unsubmerged elevations are replaced by the table coordinates (row,column) o
Write the program in Python
The town of Riverwood has been experiencing terrible flooding in the last few years and would like to have a visual representation of the problem areas based on the elevations in various regions and the expected rise of the nearby river after severe weather.
Given a two-dimensional list/table representing a grid-layout map of elevations of different regions in the area, ask the user for a predicted elevation rise in the river water and show the problem areas by replacing the elevation for that area with an asterisk (*) to indicate that the area would be completely under water with the given river rise (e.g., if the region elevation is 200 or less and the river rise is 200 then that region would be completely submerged). You should not create a new list for this but replace the appropriate elevations in the original list with asterisks. Your code should use a method called printList to print the resulting representation of the map as shown in the sample output where the asterisks are printed as they occur but the unsubmerged elevations are replaced by the table coordinates (row,column) of those elevations.
For example, if the given two-dimensional table is as follows:
elevations = [[243, 479, 549, 470, 331, 20], [492, 454, 231, 366, 65, 32], [71, 534, 285, 345, 509, 5], [204, 249, 145, 54, 211, 46], [124, 217, 545, 160, 242, 203], [461, 236, 436, 391, 508, 68], [428, 176, 85, 435, 496, 191],Sample input/output for run 1:
Enter the expected river rise: 100|0,0|0,1|0,2|0,3|0,4| * | |1,0|1,1|1,2|1,3| * | * | | * |2,1|2,2|2,3|2,4| * | |3,0|3,1|3,2| * |3,4| * | | 4,0 | 4,1 | 4,2 | 4,3 | 4,4 | 4,5 | |5,0|5,1|5,2|5,3|5,4| * | |6,0|6,1| * |6,3|6,4|6,5| |7,0|7,1|7,2|7,3|7,4| * | | 8,0 | 8,1 | 8,2 | 8,3 | 8,4 | 8,5 | |9,0|9,1|9,2| * |9,4|9,5|
Sample input/output for run 2:
Enter the expected river rise: 300| * |0,1|0,2|0,3|0,4| * | |1,0|1,1| * |1,3| * | * | | * |2,1| * |2,3|2,4| * | |*|*|*|*|*|*| | * | * | 4,2 | * | * | * | |5,0| * |5,2|5,3|5,4| * | |6,0| * | * |6,3|6,4| * | | 7,0 | * | 7,2 | * | * | * | | * |8,1|8,2| * |8,4| * | |9,0| * | * | * |9,4|9,5|
Step by step
Solved in 2 steps with 3 images