Advertisements
Advertisements
Question
Consider the following dictionary stateCapital:
stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}
Find the output of the following statement:
print(stateCapital.keys())
One Line Answer
Solution
dict_keys(['AndhraPradesh', 'Bihar', 'Maharashtra', 'Rajasthan']): 'keys()' function returns the list of the keys in the dictionary.
shaalaa.com
Manipulating Dictionaries
Is there an error in this question or solution?