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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
