Python Programming - Dictionaries - Discussion

Discussion Forum : Dictionaries - General Questions (Q.No. 19)
19.
How do you check if a key exists in a dictionary without raising an error?
key.exists()
key in dictionary
dictionary.has_key(key)
dictionary.key_exists(key)
Answer: Option
Explanation:
The in keyword is used to check if a key exists in a dictionary without raising an error.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.