add cpython comparison
This commit is contained in:
parent
5d130b5271
commit
12e2bee756
18
test-files/primes.py
Normal file
18
test-files/primes.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
def is_prime(x):
|
||||
for i in range(2, x-1):
|
||||
if x % i == 0:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
x = 2
|
||||
found = 0
|
||||
s = ""
|
||||
while found < 1000:
|
||||
if is_prime(x):
|
||||
found = found + 1
|
||||
s = f"{s}{x}\n"
|
||||
|
||||
x = x + 1
|
||||
|
||||
print(s)
|
Loading…
Reference in a new issue