Python Programming - Dictionaries - Discussion

Discussion Forum : Dictionaries - General Questions (Q.No. 43)
43.
What is the difference between the dictionary.keys() and dictionary.values() methods?
Both methods return the keys of the dictionary.
Both methods return the values of the dictionary.
dictionary.keys() returns a list of keys, while dictionary.values() returns a list of values.
dictionary.keys() returns a list of values, while dictionary.values() returns a list of keys.
Answer: Option
Explanation:
The keys() method returns a list of keys, and the values() method returns a list of values in a dictionary.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.