add cpython comparison

This commit is contained in:
Joel Wejdenstål 2022-11-02 13:09:02 +01:00
parent 5d130b5271
commit 12e2bee756
No known key found for this signature in database
GPG key ID: DF03CEFBB1A915AA

18
test-files/primes.py Normal file
View 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)