How can I check if input is a letter or character in Python?
Input should be amount of numbers user wants to check. Then program should check if input given by user be
You can use num.isnumeric() function that will return You "True" if input is number and "False" if input is not number.
>>> x = raw_input() 12345 >>> x.isdigit() True
You can also use try/catch:
try: val = int(num) except ValueError: print("Not an int!")