xiii. Which of the following function will return the key, value pairs of a dictionary?
a. keys()
b. values()
c.items()
d. All of these
Answers
Answered by
1
Answer: (c) items()
Explanation:
items() function will return the key, value pairs of a dictionary.
In Python Dictionary, items() function is used to return the list with all dictionary keys with values (in pair) .
Answered by
0
- We know that, a dictionary's values can be accessed using the keys() function.
- However, a dictionary's keys cannot be accessed using the values() function.
- The items() method in Dictionary returns a list of all dictionary keys and their values.
Hence, option C is correct.
#SPJ3
Similar questions