Answers for "python detect if number"

6

python check if number

if type(variable) == int or type(variable) == float:
    isNumber = True
Posted by: Guest on April-17-2020
2

python check if input is a number

user_input = input("Enter something:")

if type(user_input) == int:
    return user_input
else:
    print("Not a number")
Posted by: Guest on July-22-2020

Python Answers by Framework

Browse Popular Code Answers by Language