Could someone explain to me why this code will not print the 10th prime number? It says there is a syntax error on the fourth line (the x = range(3, math.sqrt(test_num)). It also says there is a syntax error on the sixth line (while prime_count < 10:).
import math
test_num = 3
prime_count = 1
x = range(3, math.sqrt(test_num))
while prime_count < 10:
if test_num % x == 0:
test_num = test_num + 2
else:
prime_count = prime_count + 1
test_num = test_num + 2
print(test_num)
raw_input("Press<enter>")