Question DSA-REC-0027
EasyWhat is the output of this code?
def g(n):
if n == 0:
return
g(n - 1)
print(n, end=" ")
g(3)
- A.
1 2 3
- B.
0 1 2 3
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Recursion and Backtracking question
What is the output of this code?
def g(n):
if n == 0:
return
g(n - 1)
print(n, end=" ")
g(3)
1 2 3
0 1 2 3
Sign up free to see the answer and a step-by-step explanation.
3 2 1
3