vault backup: 2023-11-27 13:46:08

This commit is contained in:
Louis Gallet 2023-11-27 13:46:09 +01:00
parent 1193897938
commit 967bb947a4
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -204,6 +204,16 @@ def factorial(limit: n) -> int:
return (n-1) return (n-1)
``` ```
## Exercise 2.4
```python
def prime(n: int) -> int:
"""
Check if n(int) is prime if n > 1, error otherwise
"""
if n <= 1:
raise Exception("prime: n<= 1")
elif n % 2 == 0:
return n == 2
## Exercise 3.3 ## Exercise 3.3
```python ```python
def quotient(a: int, b: int) -> int: def quotient(a: int, b: int) -> int: