diff --git a/Algo/B2/Exercises/Repetitive tutorial.md b/Algo/B2/Exercises/Repetitive tutorial.md index f3469d5..28317c3 100644 --- a/Algo/B2/Exercises/Repetitive tutorial.md +++ b/Algo/B2/Exercises/Repetitive tutorial.md @@ -84,7 +84,17 @@ def fibo(n): n -= 1 return cur # OR - +def fibo(n): + prev = 1 + cur = 1 + i = 1 + while n > 1: + prev += cur + cur += prev + i += 2 + if + return cur + else return prev ``` ## Exercise 1.5