English

Consider the following dictionary stateCapital: stateCapital = {"AndhraPradesh":"Hyderabad", "Bihar":"Patna","Maharashtra":"Mumbai", "Rajasthan":"Jaipur"} Find the output of the following statement - Computer Science (Python)

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("Maharashtra" in stateCapital)
One Line Answer

Solution

True: 'in' is a membership operator which returns true if a key is present in the dictionary.

shaalaa.com
Tuple Operations
  Is there an error in this question or solution?
Chapter 10: Tuples and Dictionaries - Exercise [Page 224]

APPEARS IN

NCERT Computer Science [English] Class 11
Chapter 10 Tuples and Dictionaries
Exercise | Q 2. vi. | Page 224
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×
Our website is made possible by ad-free subscriptions or displaying online advertisements to our visitors.
If you don't like ads you can support us by buying an ad-free subscription or please consider supporting us by disabling your ad blocker. Thank you.