From 68295d1f23896210c901f66bf168a2e0ffe1663c Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 24 Nov 2023 15:51:06 +0100 Subject: [PATCH] vault backup: 2023-11-24 15:51:06 --- Algo/B2/Exercises/Repetitive tutorial.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Algo/B2/Exercises/Repetitive tutorial.md b/Algo/B2/Exercises/Repetitive tutorial.md index 31656ac..8b365ad 100644 --- a/Algo/B2/Exercises/Repetitive tutorial.md +++ b/Algo/B2/Exercises/Repetitive tutorial.md @@ -157,7 +157,7 @@ def mu_sum(n: int) -> int: ``` ## Exercise 2.1 -``` +```python def euclid(a, b): if (a <= b): raise ValueError("a must be superior to b") @@ -169,4 +169,10 @@ def euclid(a, b): a = b b = r return oldr + +# OR +def euclid(a, b): + while b != 0: + (a, b) = (b, a%b) + return a ``` \ No newline at end of file