GATE DA Python Programming – Full Mock Test-1

Questions 1-5 of 100

0% completed (0/100 answered)
Your score 0/100 0 answered
Correct 0 Incorrect 0 Unanswered 100 Accuracy 0%

Question 1

MCQ · Single Correct 1 mark

What is the output of the following Python expression?
print(-17 // 4, -17 % 4)

Answers for question 1

Question 2

NAT · Numerical Answer 1 mark

What will be the output of the following Python code?
x = 5
y = 2
print(x << y | x >> 1)

Answers for question 2

Question 3

MCQ · Single Correct 1 mark
Previous Year Question GATE DA 2024 PYQ
PYTHON
Consider the following Python function:
def f(a, b=[]):
    b.append(a)
    return b

print(f(1), f(2), f(3))

Answers for question 3

Question 4

NAT · Numerical Answer 1 mark
Previous Year Question GATE DA 2024 PYQ

What is the value returned by calling mystery(4) for the recursive function defined below?

PYTHON
def mystery(n):
    if n <= 1:
        return 1
    return mystery(n - 1) + mystery(n - 2) + 1
Answers for question 4

Question 5

MCQ · Single Correct 1 mark

Which of the following operations has the HIGHEST operator precedence in Python?

Answers for question 5
Scroll to Top