So I am trying to make a math quiz and after the question pops up after 3 or 4 seconds the computer answers for you instead BUT if the player answers within the time limit the computer does not say the answer. I just started coding at school for a project... Thanks in advance
import time
import random
def computer():
time.sleep(5) #number of seconds the computer waits before answering
print (correct_answer)
#====================================================
from random import randint
number_1 = (randint(0,10)) #random number one
number_2 = (randint(0,10)) #random number two
print(number_1, '+', number_2, "="), #(when i tried to to as an input there was an error)
time.sleep(1) #after one second the question pops up
answer = int(input())
correct_answer = (number_1 + number_2)
if answer == correct_answer:
print ("Correct")
else:
print ("wrong")