Module 6 & 7 Flashcards
The majority of programs do the following (3 Key Components)?
INPUT: Get data from the user (direct or indirect)
keyboard, GUI, file
database, Web service
PROCESS: transform the input
count, sum, extract, etc.
derive, generate
OUTPUT: Put the result of the transformation somewhere
screen, GUI, file
database, Web service
List 3 advantages of using functions.
Simplify code
Code reuse
Better (easier) testing
Faster development
Easier facilitation of teamwork
WAR → Integrate with other tools
- Field calculators (ArcGIS Pro and QGIS)
- Task/Tools in ArcGIS Pro
- Label Expressions in ArcGIS Pro and QGIS
Describe the differences between a value-returning function and a void function.
A value-returning function has a return statement that returns a value back to the part of the program that called it.
When you call a void function, it simply executes the statements it contains and then terminates.
An element consists of a(n) _______________, followed by a colon, followed by a value.
key
If the key does not exist, it will be added to the dictionary, along with value as its _____________________value.
associated
Each _____________ that is stored in a dictionary has two parts: a key and a value.
element
The_______method returns the value associated with a specified key and removes that key-value pair from the dictionary. If the key is not found, the method returns a default value. Here is the method’s general format:
pop
When the method is called, it returns the value that is associated with the___________________ key, and it removes that key-value pair from the dictionary.
specified
If the ______________________is not found, the method returns a default value.
key
Which method returns all the values in the dictionary as a sequence of tuples?
values method
Which method returns, as a tuple, the key-value pair that was last added to the dictionary. Themethod also removes the key-value pair from the dictionary?
popitem method
Which method returns the value associated with a specified key and removes that key-value pair from the dictionary? If the key is not found, the method returns a default value.
pop method
Which method returns all the keys in a dictionary as a sequence of tuples?
keys method
Which method returns all the keys in a dictionary and their associated values as a sequence of tuples?
items method
Which method gets the value associated with a specified key. If the key is not found, the method does not raise an exception. Instead, it returns a default value?
get method