Answers for "check input value is number or string in python"

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
2

python check if string is number

txt = "565543"

x = txt.isnumeric()
Posted by: Guest on June-01-2021

Code answers related to "check input value is number or string in python"

Python Answers by Framework

Browse Popular Code Answers by Language