Python Programming - Dictionaries - Discussion

Discussion Forum : Dictionaries - General Questions (Q.No. 39)
39.
What does the expression len(dictionary.items()) return?
Returns the number of keys in the dictionary.
Returns the number of values in the dictionary.
Returns the total number of key-value pairs.
Raises a TypeError.
Answer: Option
Explanation:
The items() method returns a list of key-value pairs, and len() returns the number of items, which is the total number of key-value pairs.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.