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

Function isprime

project_euler/problem_07/sol1.py:8–18  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

6from __future__ import print_function
7from math import sqrt
8def isprime(n):
9 if (n==2):
10 return True
11 elif (n%2==0):
12 return False
13 else:
14 sq = int(sqrt(n))+1
15 for i in range(3,sq,2):
16 if(n%i==0):
17 return False
18 return True
19n = int(input())
20i=0
21j=1

Callers 1

sol1.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected