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
Larz60+ write Sep-05-2021, 03:27 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.