Considering the following dictionary: Num = {10: 'Ten', 100: 'Hundred', 10:…
2023
Considering the following dictionary: Num = {10: 'Ten', 100: 'Hundred', 10: 'Decimal'} print(Num) What shall be the output of print(Num)?
- A.
{10: 'Ten', 100: 'Hundred', 10: 'Decimal'}
- B.
{10: 'Ten', 100: 'Hundred'}
- C.
{10: 'Decimal', 100: 'Hundred'}
- D.
Error
Attempted by 1769 students.
Show answer & explanation
Correct answer: C
In a Python dictionary, duplicate keys are not allowed. If a key appears more than once, the last assigned value overwrites the previous one.