mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08: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):
|
||||
prime = True
|
||||
for i in range(2, int(number**(0.5)+2), 2):
|
||||
if i != 2:
|
||||
i = i - 1
|
||||
if number % i == 0:
|
||||
prime = False
|
||||
break
|
||||
return prime
|
||||
if number % 2 == 0 and number > 2:
|
||||
return False
|
||||
return all(number % i for i in range(3, int(math.sqrt(number)) + 1, 2))
|
||||
|
||||
def main():
|
||||
print(primeCheck(37))
|
||||
|
Loading…
Reference in New Issue
Block a user