Advertisements
Advertisements
प्रश्न
Consider the following dictionary stateCapital:
stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai",
"Rajasthan":"Jaipur"}
Find the output of the following statement:
del stateCapital["Assam"]
print(stateCapital)अति संक्षिप्त उत्तर
Advertisements
उत्तर
KeyError: 'Assam'
Because "Assam" is not present in the dictionary, the del statement gives an error, and print(stateCapital) is not executed.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
