Усович Алексей, 530 группа NonPrime 10417 | Жангирхан Шаку, 404 NonPrime 9570 | ||||
---|---|---|---|---|---|
n | 1 | def is_prime(x): | n | 1 | def is_prime(num): |
2 | if x < 2: | 2 | if num < 2: | ||
3 | return False | 3 | return False | ||
n | 4 | for i in range(2, int(x ** 0.5) + 1): | n | 4 | for i in range(2, int(num ** 0.5) + 1): |
5 | if x % i == 0: | 5 | if num % i == 0: | ||
6 | return False | 6 | return False | ||
7 | return True | 7 | return True | ||
8 | 8 | ||||
9 | def nonprime(n=0): | 9 | def nonprime(n=0): | ||
n | 10 | next = n + 1 | n | 10 | num = n + 1 |
11 | while True: | 11 | while True: | ||
t | 12 | if not is_prime(next): | t | 12 | if not is_prime(num): |
13 | yield next | 13 | yield num | ||
14 | next += 1 | 14 | num += 1 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|