MCPcopy 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'''
6def is_prime(n):
7 for i in range(2,n):
8 if n%i==0:
9 return False
10 return True
11n=int(input("Enter the number to check for Prime "))
12if is_prime(n):
13 print("Given number is a prime number")

Callers 1

CheckForPrime.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected