There's definitely something wrong with your for loop. Try this:
for x in range(n):
You might want to check if all your print statements are correct. You might be missing just a period and it will be counted wrong.
5.2m questions
6.7m answers