SyntaxFix
Write A Post
Hire A Developer
Questions
You can use the isdigit() method for strings. In this case, as you said the input is always a string:
user_input = input("Enter something:") if user_input.isdigit(): print("Is a number") else: print("Not a number")