max += 1
numbers = [False] * max
ret = []
for i in range(2, max):
if not numbers[i]:
for j in range(i, max, i):
numbers[j] = True
ret.append(i)
return ret
if __name__ == "__main__":
After Change
9973
numbers: Generator = (i for i in range(1, (max + 1)))
for i in (n for n in numbers if n > 1):
for j in range(2, i):
if (i % j) == 0:
break
else:
yield i
if __name__ == "__main__":
number = int(input("Calculate primes up to:\n>> ").strip())
for ret in primes(number):
print(ret)