Q23
Consider the following Python declarations of two lists.
A=[1,2,3]
B=[4,5,6]Which one of the following statements results in
A= [1, 2, 3, 4, 5, 6]?Show answer without attempting
Loading the answer…
GATE DA · Programming Data Structures and Algorithms · 3 questions
3 Programming in Python questions from GATE DA papers (2025), each with the official answer key. Part of Programming Data Structures and Algorithms. Answer any question right here and it is marked straight away, or practise them one at a time.
A=[1,2,3]
B=[4,5,6]A= [1, 2, 3, 4, 5, 6]?Loading the answer…
A={"this","that"}
B={"that","other"}
C={"other","this"}
while "other" in C:
if "this" in A:
A,B,C=A-B,B-C,C-A
if "that" in B:
A,B,C=C|A,A|B,B|CLoading the answer…
def f(a,b):
if (a==0):
return b
if (a%2==1):
return 2*f((a-1)/2,b)
return b+f(a-1,b)
print(f(15,10))Loading the answer…
0/30 correct0 marks