New modified Python code for Prime check

This commit is contained in:
dheerajreddymumma 2018-10-28 17:02:27 +05:30
parent 2040757751
commit 1305e74b8a

View File

@ -1,8 +1,8 @@
import math
def primeCheck(number):
if n % 2 == 0 and n > 2:
if number % 2 == 0 and number > 2:
return False
return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))
return all(number % i for i in range(3, int(math.sqrt(number)) + 1, 2))
def main():
print(primeCheck(37))