MCPcopy Create free account
hub / github.com/E869120/math-algorithm-book / isprime

Function isprime

codes/python/Code_3_01_2.py:2–7  ·  view source on GitHub ↗
(N)

Source from the content-addressed store, hash-verified

1# 2 以上の整数 N に対し、N が素数であれば true、素数でなければ false を返す関数
2def isprime(N):
3 LIMIT = int(N ** 0.5)
4 for i in range(2, LIMIT + 1):
5 if N % i == 0:
6 return False
7 return True
8
9N = int(input())
10if isprime(N):

Callers 1

Code_3_01_2.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected