The nth Fibonacci number
Loops that build on themselves.
Loops that build on themselves
The Fibonacci sequence starts 0, 1, and each number after is the sum of the two before it. A loop can carry the last two values forward and add them, step by step.
Type the function below, then run it — it should print the 10th Fibonacci number.