Last active
May 29, 2018 21:46
-
-
Save eserdinyo/ef6e9807699c69075febe3ea2737740b to your computer and use it in GitHub Desktop.
Is it Prime with Py
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
enterNum = 1 | |
counter = 0 | |
nubmerOfPrime = 0 | |
def isPrime(num): | |
global counter | |
if num > 1: | |
for i in range(2, num): | |
if num % i == 0: | |
return 1 | |
counter += 1 | |
return counter | |
while (enterNum != 0): | |
enterNum = int(input("enter num: ")) | |
nubmerOfPrime = isPrime(enterNum) | |
print("number of primes: ",nubmerOfPrime) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment