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

निम्नलिखित कोड का आउटपुट क्या है?

What is the output of following code ?

a1={1:"A",2:"B",3:"C"}
b1={4:"D",5:"E"}
b1.update(a1)
print(b1)
A)
B)
C)
D)

Explanation:

Sure! Here's a concise explanation:

  • We have two dictionaries:

    • a1 = {1: "A", 2: "B", 3: "C"}
    • b1 = {4: "D", 5: "E"}
  • The update() method adds the items from a1 to b1.

  • After b1.update(a1), b1 will include all key-value pairs from both dictionaries.

So, the final result of b1 will be:

{4: 'D', 5: 'E', 1: 'A', 2: 'B', 3: 'C'}

Output: (A)

Latest Updates