🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

निम्नलिखित कोड का परिणाम क्या है?

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}.

Latest Updates