how to check if an input is a number code example
Example 1: check if input is a number javascript
// Another option is typeof which return a string
if (typeof(val) === 'number') {
// Guess what, it's a bloody number!
}
Example 2: python check if input is a number
user_input = input("Enter something:")
if type(user_input) == int:
print("Is a number")
else:
print("Not a number")