Jun-19-2020, 11:22 PM
Please use the python tags to show your code. It's much easier to understand.
Python here is declaring that the thing that was input was not an integer. We can't see your session to know what was wrong. If you want to test if it's really an integer rather than exiting if it's not, you can wrap the action in a try/except clause.
Also, you label the raw input as
Python here is declaring that the thing that was input was not an integer. We can't see your session to know what was wrong. If you want to test if it's really an integer rather than exiting if it's not, you can wrap the action in a try/except clause.
Also, you label the raw input as
number
, and after converting to an int(), you label it user_input
. That seems backward to me. Maybe more like this:import sys user_input = input("Provide a number: ") try: number = int(user_input) except ValueError: print(f"{user_input} doesn't look like an integer to me. Exiting") sys.exit() if number % 10 == 0: print("Your number is a multiple of 10.") else: print("Your number is not a multiple of 10.")