मराठी

What will be the output of the following Python code? my_dict = {"name": "Alicia", "age": 27, "city": "DELHI"} print(my_dict.get("profession", "Not Specified")) - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

What will be the output of the following Python code?

my_dict = {"name": "Alicia", "age": 27, "city": "DELHI"}
print(my_dict.get("profession", "Not Specified"))

पर्याय

  • Alicia

  • DELHI

  • None

  • Not Specified

MCQ
Advertisements

उत्तर

Not Specified

Explanation:

The key "profession" does not exist in the dictionary.
The .get() method returns the default value "Not Specified" when the key is missing.

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2025-2026 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×