निम्नलिखित कोड का परिणाम क्या है?
What is the output of the following code?
dict={"Joey":1,"Rachel":2}
dict.update({"Phoebe":2})
print(dict)
A)
B)
C)
D)
Explanation:
The code initializes a dictionary with two key-value pairs: {"Joey": 1, "Rachel": 2}
. Then, dict.update({"Phoebe": 2})
adds a new key "Phoebe"
with value 2
to the dictionary.
The final dictionary becomes:
{"Joey": 1, "Rachel": 2, "Phoebe": 2}
So, the output is: (A) {"Joey":1, "Rachel":2, "Phoebe":2}.