Correct option is C
In Python,
dictionaries cannot have
duplicate keys. When you try to add a key that already exists in the dictionary, it will update the value associated with that key.
Given the dictionary:
Num = {10: 'Ten', 100: 'Hundred', 10: 'Decimal'}
· The key 10 is repeated in the dictionary.
· The first occurrence of 10 is associated with the value 'Ten'.
· The second occurrence of 10 will overwrite the previous entry, and it will be associated with the value 'Decimal'.
Thus, the final dictionary will be:
{10: 'Decimal', 100: 'Hundred'}
Important Key Points:
1.
No Duplicate Keys: In a dictionary, if the same key is repeated, the last value will overwrite the previous one.
2.
Key-Value Pair: A dictionary stores data in key-value pairs, and each key must be unique.
Knowledge Booster:
Option (a): This is incorrect because
duplicate keys are not allowed in a dictionary, so the second 10: 'Decimal' will overwrite the first 10: 'Ten'.
Option (b): This is incorrect because the second occurrence of 10 will overwrite the first one, so 'Ten' will not be present in the dictionary.