mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
17 lines
225 B
Python
17 lines
225 B
Python
def is_prime(x):
|
|
if x<2:
|
|
return False
|
|
|
|
for i in range(2,x):
|
|
if x%i == 0:
|
|
return False1
|
|
return True
|
|
|
|
def test(n):
|
|
k = 0
|
|
for i in range(n):
|
|
if is_prime(i):
|
|
k += 1
|
|
return k
|
|
|
|
print(test(100)) |