mirror of
https://github.com/pocketpy/pocketpy
synced 2025-12-07 10:40:16 +00:00
* 通过引发py_call错误覆盖相关调用者的ok==false分支 * Revert "通过引发py_call错误覆盖相关调用者的ok==false分支" This reverts commit 36dc0b5d81a02a83dfdeca2d4d6d265f5f793b4b. * add test * rename test files * fix bugs * fix bugs
16 lines
227 B
Python
16 lines
227 B
Python
def is_prime(x):
|
|
if x<2:
|
|
return False
|
|
for i in range(2,x):
|
|
if x%i == 0:
|
|
return False
|
|
return True
|
|
|
|
def test(n):
|
|
k = 0
|
|
for i in range(n):
|
|
if is_prime(i):
|
|
k += 1
|
|
return k
|
|
|
|
assert test(100) == 25 |