The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #257
def test(i,j):
if(i==0):
return j
else:
return test(i-1,i+j)
print(test(4,7))
The function will continue to call itself until i becomes 0. i and j will respectively become 4 and 7, 3 and 11, 2 and 14, 1 and 16. Eventually, 17 is returned. (programiz.com/python-programming/recursion)
Question difficulty: 🔵🔵🔵🔵🔵