🔍
What is the output of the following code? a={1:"A",2:"B",3:"C"}
b={4:"D",5:"E"}
a.update(b)
print(a)
a) {1: ‘A’, 2: ‘B’, 3: ‘C’}
b) Method update() doesn’t exist for dictionaries
c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}
d) {4: ‘D’, 5: ‘E’}
0 like 0 dislike

1 Answer

c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}
0 like 0 dislike

Related questions

What is the output of the following code? >>> a=(2,3,4) >>> sum(a,3) a) Too many arguments for sum() method b) The method sum() doesn’t exist for tuples c) 12 d) 9
Answer : c) 12...

View solution
0 like 0 dislike
1 answer

What is the output of the following? i = 1 while True: if i%2 == 0: break print(i) i += 2 a) 1 Page No 13 b) 1 2 c) 1 2 3 4 5 6 … d) 1 3 5 7 9 11 …
Answer : d) 1 3 5 7 9 11 …...

View solution
0 like 0 dislike
1 answer

What is the output of the following code? a={1:"A",2:"B",3:"C"} print(a.setdefault(3)) a) {1: ‘A’, 2: ‘B’, 3: ‘C’} b) C c) {1: 3, 2: 3, 3: 3} d) No method called setdefault() exists for dictionary
Answer : b) C...

View solution
0 like 0 dislike
1 answer

hat is the output of the following? i = 5 while True: if i%0O11 == 0: Page No 12 break print(i) i += 1 a) 5 6 7 8 9 10 b) 5 6 7 8 c) 5 6 d) error
Answer : b) 5 6 7 8...

View solution
0 like 0 dislike
1 answer

What is the output of the following? d = {0: 'a', 1: 'b', 2: 'c'} for i in d: print(i) Page No 18 a) 0 1 2 b) a b c c) 0 a 1 b 2 c d) none of the mentioned
Answer : a) 0 1 2...

View solution
0 like 0 dislike
1 answer

50.5k questions

47.1k answers

240 comments

7.0k users