vault backup: 2023-11-27 13:46:08
This commit is contained in:
parent
1193897938
commit
967bb947a4
@ -204,6 +204,16 @@ def factorial(limit: n) -> int:
|
||||
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
|
||||
```python
|
||||
def quotient(a: int, b: int) -> int:
|
||||
|
Loading…
x
Reference in New Issue
Block a user