Question: From Python for ArcGIS textbook by Laura Tateosian: A sample script contains the following dictionary: tides = {'G1': [1,6], 'G2': [2], 'G3': [3,8,9]} These represent
From Python for ArcGIS textbook by Laura Tateosian:
A sample script contains the following dictionary:
tides = {'G1': [1,6], 'G2': [2], 'G3': [3,8,9]}
These represent tide gauge readings for three gauges, 'G1', 'G2', 'G3'. Use the keys, values, and items dictionary methods to perform the following updates and calculations:
a) Append a reading of 7 for each gauge (then print the dictionary.)
b) Print the number of readings for each gauge.
c) Square the value of every reading fore very gauge (then print the dictionary.)
d) Find the minimum reading for each gauge in the dictionary.
Printed output should appear as follows:
>>> 1. {'G3': [3, 8, 9, 7], 'G2': [2, 7], 'G1':[1, 6, 7]}
2. Number of readings: 4
2. Number of readings: 2
2. Number of readings: 3
3. {'G3': [9, 64, 81, 49], 'G2': [4, 49], 'G1': [1, 36, 49]}
4. Min reading at gauge G3 = 9
4. Min reading at gauge G2 = 4
4. Min reading at gauge G1 = 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
