how to check for input python code example
Example 1: python check if string is in input
try:
val = int(userInput)
except ValueError:
print("That's not an int!")
Example 2: how to do an if input = python
start_over = 1
question = input("Do you wish to try again? y/n: ")
if question == "y":
start_over -= 1
else:
raise SystemExit