GATE DA Python Programming – Full Mock Test-1

Questions 6-10 of 100

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

Question 6

NAT · Numerical Answer 1 mark

What will be printed by the following code snippet?
count = 0
for i in range(1, 10, 2):
for j in range(i, 0, -2):
count += 1
print(count)

Answers for question 6

Question 7

MCQ · Single Correct 1 mark
Previous Year Question GATE DA 2024 PYQ
PYTHON
What is the output of the following code?
def outer():
 x = 10
 def inner():
 nonlocal x
 x += 5
 return x
 return inner

$f = outer()
print(f(), f())$

Answers for question 7

Question 8

NAT · Numerical Answer 1 mark

How many times is the function foo called in total (including the initial call foo(18, 12))?

PYTHON
def foo(a, b):
 if b == 0:
 return a
 return foo(b, a % b)
Answers for question 8

Question 9

MCQ · Single Correct 1 mark

What is the output of bool('False') and bool('') in Python?

Answers for question 9

Question 10

NAT · Numerical Answer 1 mark

What will be the output of len(set('abracadabra'))?

Answers for question 10
Scroll to Top