I’m new at programming. How can I get an error message if I input a string, using an if else
statement in Python.
x = int(input("Enter the no."))
if (x>5):
print (x ,'Is greater than 5')
elif (x==str):enter code here
print('Incorrect input')
elif (x==5):
print (x ,'Is equal to 5')
elif (x<5):
print (x ,'Is less than 5')
else:
print (x ,'none of the above!')