solution = 7 answer = input ("What is 5 + 2?") if answer == solution: print("You are correct!") print (f"Your answer was {answer}") print (f"and the solution is {solution}") else: print("You are not correct") print (f"Your answer was {answer}") print (f"and the solution is {solution}")You would think that entering a 7 for the answer would get a print of 'You are Correct!,
but it always comes up like this:
Output:$ python ex4-1.py
What is 5 + 2?7
You are not correct
Your answer was 7
and the solution is 7
What am I missing?
buran write Nov-13-2024, 06:39 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.