Q. Which method returns all keys in a dictionary?
Solution:
keys() returns a view of all keys, e.g., {‘a’: 1}.keys() = dict_keys([‘a’]).
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.
keys() returns a view of all keys, e.g., {‘a’: 1}.keys() = dict_keys([‘a’]).
Strengthen Your Practice with our comprehensive question bank.