using Python I'm currently attempting Project Euler Problem #7 which asks to find the 10001st prime number, however when running my code I encounter the error
"File "<stdin>", line 3
TestedValue = 2
^
IndentationError: unexpected indent
Unknown error."
I'm assuming that isn't the only line which is facing that error but that's the first one that pops up, any idea what I'm doing wrong? Thanks SO!
Code:
def PrimeNum(NumIn):
PrimeNumCounter = 0
TestedValue = 2
if TestedValue == 2:
PrimeNumCounter += 1
TestedValue += 1
else:
while PrimeNumCounter != NumIn-1
for i in range(2, TestedValue):
Prelim = 0
if TestedValue % i != 0:
Prelim += 1
elif TestedValue % i == 0:
Prelim = 0
if Prelim > 0:
PrimeNumCounter += 1
if PrimeNumCounter == NumIn-1:
for i in range(2, TestedValue):
Prelim = 0
if TestedValue % i != 0:
Prelim += 1
elif TestedValue % i == 0:
Prelim = 0
if Prelim > 0:
print TestedValue