Dictionary Methods

What does the dictionary method get() do?

The get() method returns the value associated with a key if that key exists in the dictionary. If the key doesn't exist, get() returns None, not an error, and if you can also pass a default value to be returned if the key doesn't exist.

What does the method keys() do?

The method keys() returns the keys of a dictionary that also help you loop through a dictionary.

What does the method values() do?

The method values() returns the values of a dictionary that also help you loop through a dictionary.

What does the method items() do?

The method items() returns the items, with both its keys and values, of a dictionary that also help you loop through a dictionary.