MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / isprime

Function isprime

project_euler/problem_03/sol1.py:10–19  ·  view source on GitHub ↗
(no)

Source from the content-addressed store, hash-verified

8import math
9
10def isprime(no):
11 if(no==2):
12 return True
13 elif (no%2==0):
14 return False
15 sq = int(math.sqrt(no))+1
16 for i in range(3,sq,2):
17 if(no%i==0):
18 return False
19 return True
20
21maxNumber = 0
22n=int(input())

Callers 1

sol1.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected