vault backup: 2023-11-27 13:50:43
This commit is contained in:
parent
967bb947a4
commit
a8f94175a8
@ -214,6 +214,11 @@ def prime(n: int) -> int:
|
||||
raise Exception("prime: n<= 1")
|
||||
elif n % 2 == 0:
|
||||
return n == 2
|
||||
else:
|
||||
d = 3
|
||||
while d*d <= n and n % d!= 0:
|
||||
d += 2
|
||||
return d*d > n
|
||||
## Exercise 3.3
|
||||
```python
|
||||
def quotient(a: int, b: int) -> int:
|
||||
|
Loading…
x
Reference in New Issue
Block a user