Sep-05-2021, 02:22 AM
Hi All,
UPDATE - I fixed it - I had to force the input typo be an integer for the comparison
I am trying to make a multiplication tester program for school. I had the following code working at one stage, but after I tried to make some edits to loop its operation, it stopped evaluating the answers properly. I parsed it back to the original but it won't work and it id driving me crazy!
This is the code - it ALWAYS says "wrong answer" - I know my multiplication isn't THAT bad - help!
UPDATE - I fixed it - I had to force the input typo be an integer for the comparison
I am trying to make a multiplication tester program for school. I had the following code working at one stage, but after I tried to make some edits to loop its operation, it stopped evaluating the answers properly. I parsed it back to the original but it won't work and it id driving me crazy!
This is the code - it ALWAYS says "wrong answer" - I know my multiplication isn't THAT bad - help!
from tkinter import * import tkinter as ttk import random from random import randrange x = randrange(0,10) y = randrange(0,10) print("what is ",x," multiplied by ",y) user_answer = input(": ") answer = x*y if user_answer == answer: print("Correct!!!!") else: print("Wrong answer bruh...")Simon