Single Choice Not Set

QWhat will be the output after the following statements?
x = {'year': 2016, 'month': 'March'}
x.setdefault('day', 'Tuesday')
print(x)

ID: #4039 Python Dictionary MCQ 319 views
Question Info
#4039Q ID
Not SetDifficulty
Python Dictionary MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A ('day', 'Tuesday')
  • B {'day': 'Tuesday', 'month': 'March'}
  • C 'day': 'Tuesday', 'month': 'March', 'year': 2016
  • D {'day': 'Tuesday', 'month': 'March', 'year': 2016}
Correct Answer

Explanation

{'day': 'Tuesday', 'month': 'March', 'year': 2016}

Share This Question

Challenge a friend or share with your study group.