My goal is to build a calculator, where the user is asked to choose what kind of mathematics they would like to do (Roots, addition, etc). They would then be asked to enter two numbers. At the moment, the user can enter random letters when it asks for the numbers and that ends the program. I have tried a few things to test if their input is an integer, in this function:
def vargrab():
x = (input("Enter a number: "))
y = (input("Enter a number: "))
if x or y != int:
print("Invalid answer")
x = 0
y = 0
vargrab()
I am quite new to python. Any advice would help!