Created
August 20, 2017 10:56
-
-
Save savolla/c11843ff45594696c39ab0187e239bdc to your computer and use it in GitHub Desktop.
Takes an integer and checks if its a prime number.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array = [] | |
number = int(input()) | |
for i in range(1,(number+1)): | |
modulo = (number % i) | |
if (modulo == 0): | |
array.append(modulo) | |
elif (len(array) > 2): | |
break | |
else: | |
continue | |
if (len(array) == 2): | |
print(number, "is prime <3 <3 <3") | |
else: | |
print("NOPE..", number, "is not prime.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment