+ 1
Why does the process do it in the form of a loop if there is no while or for?
def fib(x): if x == 0 or x == 1: return 1 else: return fib(x-1) + fib(x-2) print(fib(4))
2 Antworten
+ 3
The keyword is "recursion".
Have a look at lesson 68 of the Python Core course again.
+ 1
You better search for recursive tutorial on the web, it is not a easy topic and Sololearn could not explain this concept very deeply.