vault backup: 2023-11-24 14:22:03

This commit is contained in:
2023-11-24 14:22:03 +01:00
parent 95d5b547dc
commit aed37bf953
2 changed files with 37 additions and 5 deletions

View File

@ -13,7 +13,7 @@
"state": {
"type": "markdown",
"state": {
"file": "Prog/Collections.md",
"file": "Algo/B2/Exercises/Repetitive tutorial.md",
"mode": "source",
"source": false
}
@ -85,7 +85,7 @@
"state": {
"type": "backlink",
"state": {
"file": "Prog/Collections.md",
"file": "Algo/B2/Exercises/Repetitive tutorial.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@ -102,7 +102,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "Prog/Collections.md",
"file": "Algo/B2/Exercises/Repetitive tutorial.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
@ -125,7 +125,7 @@
"state": {
"type": "outline",
"state": {
"file": "Prog/Collections.md"
"file": "Algo/B2/Exercises/Repetitive tutorial.md"
}
}
},
@ -156,7 +156,7 @@
"command-palette:Open command palette": false
}
},
"active": "41ec48cdc3af71a1",
"active": "c473a791e2b34194",
"lastOpenFiles": [
"Prog/Collections.md",
"Algo/B2/Exercises/Repetitive tutorial.md",

View File

@ -72,3 +72,35 @@ def power(x, n):
n -= 1
return res
```
## Exercise 1.4
```python
def fibo(n: int) -> int:
a = 0
b = 1
c = 0
i = 2
while i <= n:
c = a + b
a = b
b = c
i += 1
return b
```
## Exercise 1.5
```python
def my_sum(n: int) -> int:
s = 0
i = 1
while i <= n:
s += u(i)
i += 1
return s
def my_sum(n: int) -> int:
s = 0
while n > 0:
s += u(n)
n -= 1
return s