Multiple choice

In Python the get() belonging to a dictionary does what?

  1. Uses a value to return the key

  2. Uses a value to return a value

  3. Uses a key to return a value

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The get() method in Python dictionaries is used to retrieve the value associated with a specified key. If the key does not exist in the dictionary, it returns None (or a specified default value) instead of raising an error.