Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question from Python for ArcGIS textbook by Laura Tateosian: The following script has a tide gauge dictionary tides = {'G1': [1,6], 'G2': [2], 'G3': [3,8,9]}.

Question from Python for ArcGIS textbook by Laura Tateosian:

The following script has a tide gauge dictionary tides = {'G1': [1,6], 'G2': [2], 'G3': [3,8,9]}. The dictionary currently stores tide gauge readings for three gauges, G1, G2, and G3. Notice that each value in the dictionary is a Python list, so that one or more readings can be recorded for each gauge. Whenever a new item is added to the dictionary, the value must be a Python list, so that the item can store multiple readings for that gauge. Use dictionary operations to reflect each of the following events and print the dictionary after each step:

a) A new gauge, G5, has been installed and the first reading was 2.

b) Record an additional reading for gauge G5, the number 6.

c) The latest reading from gauge G3 is invalid. Discard this information using the list pop() method.

d) A new gauge G6 has been installed but no readings are recorded yet. Use an empty list as a placeholder.

e) Gauge G3 is no longer collecting data. Remove the item that represents this gauge.

f) Gauge G1 recorded measurements two times higher than they should be. Use list comprehension to correct this error.

Script:

# tideRecords.py # Purpose: Practice performing dictionary operations. # Usage: No arguments needed.

tides = {'G1': [1, 6], 'G2': [2], 'G3': [3, 8, 9]}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Deductive And Object Oriented Databases Second International Conference Dood 91 Munich Germany December 18 1991 Proceedings Lncs 566

Authors: Claude Delobel ,Michael Kifer ,Yoshifumi Masunaga

1st Edition

3540550151, 978-3540550150

More Books

Students also viewed these Databases questions

Question

1. What are the pros and cons of five sources of job candidates?

Answered: 1 week ago