Question DSA-REC-0042
MediumWhat is the output of this code?
def p(n):
if n == 0:
return
p(n - 1)
print(n, end=" ")
p(n - 1)
p(3)
- A.
1 2 1 3 1 2 1
- B.
1 1 2 1 1 2 3
- C.
Sign up free to see the answer and a step-by-step explanation.