vault backup: 2023-11-24 14:33:51

This commit is contained in:
Louis Gallet 2023-11-24 14:33:51 +01:00
parent fd79eb30a2
commit 601e9f0dd6
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -76,17 +76,15 @@ def power(x, n):
## Exercise 1.4 ## Exercise 1.4
```python ```python
def fibo(n: int) -> int: def fibo(n):
a = 0 prev = 1 #f0
b = 1 cur = 1 #f1
c = 0 while n> 1:
i = 2 (prev, cur) = (cur, prev+cur)
while i <= n: n -= 1
c = a + b return cur
a = b # OR
b = c
i += 1
return b
``` ```
## Exercise 1.5 ## Exercise 1.5