Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codemistic/Data-Structures-and-Algorithms
/ is_prime
Function
is_prime
Python/CheckForPrime.py:6–10 ·
view source on GitHub ↗
(n)
Source
from the content-addressed store, hash-verified
4
(e.g. 2, 3, 5, 7, 11).
5
''
&
#x27;
6
def
is_prime(n):
7
for
i in range(2,n):
8
if
n%i==0:
9
return
False
10
return
True
11
n=int(input(
"Enter the number to check for Prime "
))
12
if
is_prime(n):
13
print(
"Given number is a prime number"
)
Callers
1
CheckForPrime.py
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected