if (ans1 == answerkey):
    print ("Correct. Good Job!!")
    right += 1
else:
    print ('Good try, here is the correct answers.')
    x = answerkey
    for i in range(1,initial_num2+1):
        if (i == x):
            print('[ >{}< ]'.format(i), end=' ')
        else:
            print('[{}]'.format(i), end=' ')
wrong += 1
time.sleep(15)
Can someone tell me why under the else statement, it would sleep for 15 seconds before running the "for i in range(1,initial_num2+1):" loop ? The only thing I can think of is the "end=' '" causing the issue because I am trying to have the loop print on the same line.
 
    