May-25-2019, 11:21 AM
I made a math trainer and here's the code:
I hope someone can help me.
from time import sleep from random import randint ingame= 1 while ingame< 2: num1= randint(1,9) num2= randint(1,9) print('What is',num1,'x',num2,'?') answer= input('> ') total= num1*num2 if answer!= total: print('Correct') sleep(1) else: print('Wrong') sleep(1) ingame= 3 else: exit()The problem with this program is that I ALWAYS get (after the input) the output 'Correct' and then it continues. I don't know what I did wrong because I'm a newbie. I mean, I am a REAL NOOB!
I hope someone can help me.