Федор Попко, 405 группа NonPrime 8915 | Арсен Жуматай,304 NonPrime 9543 | ||||
---|---|---|---|---|---|
f | 1 | def nonprime(n=0): | f | 1 | def nonprime(n=0): |
2 | 2 | ||||
n | 3 | def is_prime(num): | n | 3 | def is_prime(x): |
4 | if num < 2: | 4 | if x < 2: | ||
5 | return False | 5 | return False | ||
n | 6 | for i in range(2, int(num ** 0.5) + 1): | n | 6 | for i in range(2, int(x ** 0.5) + 1): |
7 | if num % i == 0: | 7 | if x % i == 0: | ||
8 | return False | 8 | return False | ||
9 | return True | 9 | return True | ||
n | 10 | current = n + 1 | n | 10 | num = n + 1 |
11 | while True: | 11 | while True: | ||
t | 12 | if not is_prime(current): | t | 12 | if not is_prime(num): |
13 | yield current | 13 | yield num | ||
14 | current += 1 | 14 | num += 1 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|