Багров Дмитрий Андреевич, 620 группа NonPrime 9674 | Каплан Владимир Сергеевич 611 ВМК NonPrime 9361 | ||||
---|---|---|---|---|---|
n | 1 | def is_prime(n): | n | 1 | def check_prime(number): |
2 | if n <= 1: | 2 | if number <= 1: | ||
3 | return False | 3 | return False | ||
n | 4 | for i in range(2, int(n ** 0.5) + 1): | n | 4 | for j in range(2, int(number ** 0.5) + 1): |
5 | if n % i == 0: | 5 | if number % j == 0: | ||
6 | return False | 6 | return False | ||
7 | return True | 7 | return True | ||
8 | 8 | ||||
n | 9 | def nonprime(n=0): | n | 9 | def nonprime(start=0): |
10 | num = n + 1 | 10 | value = start + 1 | ||
11 | while True: | 11 | while True: | ||
t | 12 | if not is_prime(num): | t | 12 | if not check_prime(value): |
13 | yield num | 13 | yield value | ||
14 | num += 1 | 14 | value += 1 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|