+ 2
how can i show in the output all of the steps that that function displays?
A recursion exemple. https://code.sololearn.com/c4GeyCIj5QaV/?ref=app
2 Respostas
+ 3
It's just the creation of a string you like to return. use f-string, because it's much more convenient:
return f'{level}, {level_g(level-1)},level = {l} + {ll}'
# output is: 5, 4, 3, 2, 1,level = 2 + 1,level = 3 + 2,level = 4 + 3,level = 5 + 4