Filter by year

Programming in Python questions

Q23

GATE DA 2025 DAProgramming in PythonMCQ1 mark−1/3 if wrong

Report a problem with Q23

What is wrong?
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…

Q47

GATE DA 2025 DAProgramming in PythonMCQ2 marks−2/3 if wrong

Report a problem with Q47

What is wrong?
Consider the following Python code snippet.
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|C
When the above program is executed, at the end, which of the following sets contains "this"?
Show answer without attempting

Loading the answer…

Q63

GATE DA 2025 DAProgramming in PythonNAT2 marks

Report a problem with Q63

What is wrong?
Consider the following Python code snippet.
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))
The value printed by the code snippet is __________ (Answer in integer)
Show answer without attempting

Loading the answer…

0/30 correct0 marks

Related topics in Programming Data Structures and Algorithms