I want to create an if statement to check whether the number entered is an int or not. I don't know what to do as I am splitting an input (You enter 3d and a variable with 3 and one with d is made). I want it so that if you enter a letter then it doesn't produce an error message.
Here is the code in Question:
while directionloop ==0: while DAmountLoop==0: direction=input('How do you want to move? Your answer should look like this 4u, this moves you up 4: ') directiondirection=str(direction[1]) directionamount=(direction[0]) if type(directionamount) != int: print('You need to enter a number for the amount you want to move') elif type(directionamount) == int: directionamount=int(direction[0]) DAmountLoop=1