Python Programming - Dictionaries - Discussion

Discussion Forum : Dictionaries - General Questions (Q.No. 27)
27.
What is the result of the expression dictionary.get('key')?
Returns the value for 'key' if present, otherwise returns None.
Raises a KeyError if 'key' is not present.
Returns True if 'key' is present, False otherwise.
Returns a tuple containing 'key' and its value.
Answer: Option
Explanation:
The get() method returns the value for 'key' if present, otherwise returns None.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.