Q. Which method returns all keys in a dictionary?

A
keys()
B
values()
C
items()
D
list()
Solution:

keys() returns a view of all keys, e.g., {‘a’: 1}.keys() = dict_keys([‘a’]).

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!