mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-30 16:31:08 +00:00
New modified Python code for Prime check
This commit is contained in:
parent
2040757751
commit
1305e74b8a
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user