feat(solution): problem #7

main
steven 2023-07-31 13:03:20 -04:00
parent 4ce3e54c1b
commit 838417781a
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
import math
primeCounter = 0
currentNumber = 1
def is_prime(maybeprime):
for i in range(2, math.floor(math.sqrt(maybeprime) + 1)):
if maybeprime % i == 0:
return False
return True
while primeCounter <= 10000:
currentNumber += 1
if is_prime(currentNumber):
primeCounter += 1
print("Prime number " + str(primeCounter) + " is: " + str(currentNumber))