feat: 📝 Update repo
This commit is contained in:
parent
34a3ad835a
commit
e083301e82
23
.obsidian/workspace.json
vendored
23
.obsidian/workspace.json
vendored
@ -10,25 +10,16 @@
|
|||||||
{
|
{
|
||||||
"id": "9f9ffb40dcd212ab",
|
"id": "9f9ffb40dcd212ab",
|
||||||
"type": "leaf",
|
"type": "leaf",
|
||||||
"state": {
|
|
||||||
"type": "empty",
|
|
||||||
"state": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "753ff8810fce3fd0",
|
|
||||||
"type": "leaf",
|
|
||||||
"state": {
|
"state": {
|
||||||
"type": "markdown",
|
"type": "markdown",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Prog/Array.md",
|
"file": "Algo/B2/Exercises/Repetitive tutorial.md",
|
||||||
"mode": "source",
|
"mode": "source",
|
||||||
"source": false
|
"source": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"currentTab": 1
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "vertical"
|
"direction": "vertical"
|
||||||
@ -94,7 +85,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "backlink",
|
"type": "backlink",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Prog/Array.md",
|
"file": "Algo/B2/Exercises/Repetitive tutorial.md",
|
||||||
"collapseAll": false,
|
"collapseAll": false,
|
||||||
"extraContext": false,
|
"extraContext": false,
|
||||||
"sortOrder": "alphabetical",
|
"sortOrder": "alphabetical",
|
||||||
@ -111,7 +102,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "outgoing-link",
|
"type": "outgoing-link",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Prog/Array.md",
|
"file": "Algo/B2/Exercises/Repetitive tutorial.md",
|
||||||
"linksCollapsed": false,
|
"linksCollapsed": false,
|
||||||
"unlinkedCollapsed": true
|
"unlinkedCollapsed": true
|
||||||
}
|
}
|
||||||
@ -134,7 +125,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "outline",
|
"type": "outline",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Prog/Array.md"
|
"file": "Algo/B2/Exercises/Repetitive tutorial.md"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -165,9 +156,10 @@
|
|||||||
"command-palette:Open command palette": false
|
"command-palette:Open command palette": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"active": "753ff8810fce3fd0",
|
"active": "9f9ffb40dcd212ab",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Algo/B2/Exercises/Imperative exercise.md",
|
"Algo/B2/Exercises/Imperative exercise.md",
|
||||||
|
"Algo/B2/Exercises/Repetitive tutorial.md",
|
||||||
"Prog/Array.md",
|
"Prog/Array.md",
|
||||||
"Algo/B2/Exercises",
|
"Algo/B2/Exercises",
|
||||||
"Algo/B2",
|
"Algo/B2",
|
||||||
@ -201,7 +193,6 @@
|
|||||||
"Architecture/Ressources.md",
|
"Architecture/Ressources.md",
|
||||||
"Architecture",
|
"Architecture",
|
||||||
"English",
|
"English",
|
||||||
"README.md",
|
|
||||||
"COM-ADMR",
|
"COM-ADMR",
|
||||||
"Algo/B1/Séminaire/assets/exception-meme.png",
|
"Algo/B1/Séminaire/assets/exception-meme.png",
|
||||||
"Algo/B1/Séminaire/assets/filter-meme.png",
|
"Algo/B1/Séminaire/assets/filter-meme.png",
|
||||||
|
@ -41,6 +41,26 @@ def max3 (x: int, y: int, z: int) -> int:
|
|||||||
return m
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
def max3(x: int, y: int, z: int) -> int:
|
||||||
|
"""
|
||||||
|
Function that return the max of 3 numbers
|
||||||
|
::params:
|
||||||
|
x: int -> The first value
|
||||||
|
y: int -> The second value
|
||||||
|
z: int -> The third value
|
||||||
|
::returns:
|
||||||
|
The value of the biggest value
|
||||||
|
"""
|
||||||
|
if x > y:
|
||||||
|
m = x
|
||||||
|
else:
|
||||||
|
m = y
|
||||||
|
if m > z:
|
||||||
|
return m
|
||||||
|
else:
|
||||||
|
return z
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("Give a 3-digit number")
|
print("Give a 3-digit number")
|
||||||
n = int(input())
|
n = int(input())
|
||||||
|
46
Algo/B2/Exercises/Repetitive tutorial.md
Normal file
46
Algo/B2/Exercises/Repetitive tutorial.md
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
## Exercise 1.1
|
||||||
|
```python
|
||||||
|
def zorglub(n: int) -> int:
|
||||||
|
j = 1
|
||||||
|
k = 0
|
||||||
|
i = 1
|
||||||
|
while i <= n:
|
||||||
|
j = i * j
|
||||||
|
k = j + k
|
||||||
|
i = i + 1
|
||||||
|
return k
|
||||||
|
```
|
||||||
|
|
||||||
|
The function return the sum of the factorial of n
|
||||||
|
|
||||||
|
## Exercise 1.2
|
||||||
|
```
|
||||||
|
def multiplication(x: int, y: int) -> int:
|
||||||
|
result = 0
|
||||||
|
for i in range(y):
|
||||||
|
result = result + x
|
||||||
|
return result
|
||||||
|
|
||||||
|
def multiplication2(x: int, y: int) -> int:
|
||||||
|
result = 0
|
||||||
|
if x < 0 and y < 0:
|
||||||
|
i = 0
|
||||||
|
x = -x
|
||||||
|
y = -y
|
||||||
|
while i < y:
|
||||||
|
result = result + x
|
||||||
|
i += 1
|
||||||
|
return result
|
||||||
|
elif y < 0:
|
||||||
|
y = -y
|
||||||
|
i = 0
|
||||||
|
while i < y:
|
||||||
|
result = result + x
|
||||||
|
i += 1
|
||||||
|
return -result
|
||||||
|
else:
|
||||||
|
i = 0
|
||||||
|
while i < y:
|
||||||
|
result = result + x
|
||||||
|
i += 1
|
||||||
|
return result
|
Loading…
x
Reference in New Issue
Block a user