177k views
2 votes
What is the output of the following Python statements?

def recurse(a):
if (a == 0):
print(a)
else:
recurse(a)
recurse(1)
Select one:
a. 0
b. 1
c. no output
d. RuntimeError: maximum recursion depth exceeded Correct

User Jpavlov
by
8.8k points

1 Answer

2 votes

Answer:

The given code will result in (d) RuntimeError: maximum recursion depth exceeded.

User Monoman
by
8.1k points