doublem1nt84 NonPrime 9262 | Камардин Богдан Михайлович 307 NonPrime 8764 | ||||
---|---|---|---|---|---|
f | 1 | def nonprime(n=0): | f | 1 | def nonprime(n=0): |
n | 2 | now = n + 1 | n | 2 | k = n + 1 |
3 | while True: | 3 | while True: | ||
t | 4 | if now == 1: | t | 4 | if k == 1: |
5 | yield now | 5 | yield k | ||
6 | else: | ||||
6 | for i in range(2, int(now ** 0.5) + 1): | 7 | for i in range(2, int(k ** 0.5) + 1): | ||
7 | if now % i == 0: | 8 | if k % i == 0: | ||
8 | yield now | 9 | yield k | ||
9 | break | 10 | break | ||
10 | now += 1 | 11 | k += 1 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|