mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 00:37:02 +00:00
Merge branch 'master' of git://github.com/dheerajreddymumma/Python
This commit is contained in:
commit
fa4276d2c0
|
@ -1,12 +1,8 @@
|
||||||
|
import math
|
||||||
def primeCheck(number):
|
def primeCheck(number):
|
||||||
prime = True
|
if number % 2 == 0 and number > 2:
|
||||||
for i in range(2, int(number**(0.5)+2), 2):
|
return False
|
||||||
if i != 2:
|
return all(number % i for i in range(3, int(math.sqrt(number)) + 1, 2))
|
||||||
i = i - 1
|
|
||||||
if number % i == 0:
|
|
||||||
prime = False
|
|
||||||
break
|
|
||||||
return prime
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print(primeCheck(37))
|
print(primeCheck(37))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user