Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Random_Py_scripts/check_primes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/python
"""Script to return if a number is prime"""

def check_primes(num_to_check):
Expand All @@ -6,11 +7,9 @@ def check_primes(num_to_check):
"""
count = 0
for i in range(2, num_to_check):
if num_to_check%i == 0:
count = count+1
if count == 0:
return 1
return 0
if num_to_check % i == 0:
return 0
return 1

if __name__ == "__main__":
NUM = int(input())
Expand Down