Федченко Данил 307 NonPrime 10426 | Исанбеков Дамир 414 КФ NonPrime 11343 | ||||
---|---|---|---|---|---|
f | 1 | def nonprime(n=0): | f | 1 | def nonprime(n=0): |
n | 2 | num = n + 1 | n | 2 | current = n + 1 |
3 | while True: | 3 | while True: | ||
n | 4 | if not is_prime(num): | n | 4 | if not is_prime(current): |
5 | yield num | 5 | yield current | ||
6 | num += 1 | 6 | current += 1 | ||
7 | 7 | ||||
8 | def is_prime(num): | 8 | def is_prime(num): | ||
t | 9 | if num == 1: | t | 9 | if num <= 1: |
10 | return False | 10 | return False | ||
11 | for i in range(2, int(num ** 0.5) + 1): | 11 | for i in range(2, int(num ** 0.5) + 1): | ||
12 | if num % i == 0: | 12 | if num % i == 0: | ||
13 | return False | 13 | return False | ||
14 | return True | 14 | return True |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|