Consider the following dictionary: Num = {10 : 'Ten', 100 : 'Hundred', 10: 'Decimal'}
Consider the following dictionary:
Num = {10 : 'Ten', 100 : 'Hundred', 10: 'Decimal'}
What shall be the output of print (Num)?
Show answerHide answer
Correct answer: (C) {10 : 'Decimal', 100 : 'Hundred'}
Explanation
Dictionary keys must be unique. The second 10 overwrites the first value but keeps the key's original position, giving {10: 'Decimal', 100: 'Hundred'}.