Unit 14 Flashcards
14.2 - Dictionary Methods
What does xdict.clear()
do?
removes all items from the dictionary
14.2 - Dictionary Methods
What does xdict.get(key, def)
do?
finds val of key, if none returns def
14.2 - Dictionary Methods
What does xdict.update(ydict)
do?
merges dictionaries, overwrites duplicate keys
14.2 - Dictionary Methods
What does xdict.pop(key, def)
do?
removes key from dict, returns def if nonexistant
14.3 - iterating Over a Dictionary
What is a hash?
an int representing a key/value pair for quick lookup
14.3 - iterating Over a Dictionary
What does xdict.items()
do?
displays keys & values as tuples
14.3 - iterating Over a Dictionary
What does xdict.keys()
do?
displays keys
14.3 - iterating Over a Dictionary
What does xdict.values()
do?
displays values
14.4 - Dictionary Nesting
What is data structure?
a method of organizing data in a logical and cohesive fashion