PCAP Exam QuestionsBrowse all questions from this exam

PCAP Exam - Question 51


Executing the following snippet -

will cause the dct:

Show Answer
Correct Answer: C

In a dictionary, keys must be unique. When you assign a new value to an existing key, the new value overwrites the old one. Therefore, after executing the given code, the dictionary will hold one key named 'pi' linked to the value 3.1415.

Discussion

2 comments
Sign in to comment
SuvabrataOption: C
Jun 6, 2022

Correct answer is C. Reason is, for keys with same name, the value get overwritten.

macxszOption: C
May 3, 2022

C. to hold one key named 'pi' linked to 3.1415