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.get("Bihar"))One Line Answer
Advertisements
Solution
Patna: 'get()' function returns the value corresponding to the key passed as an argument.
shaalaa.com
Dictionary Methods and Built-in Functions in Python
Is there an error in this question or solution?
Chapter 10: Tuples and Dictionaries - Exercise [Page 224]
