Answers for "python input only numbers"

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
0

python input integer only

num = int(input("Enter an integer number: "))
Posted by: Guest on August-31-2020

Python Answers by Framework

Browse Popular Code Answers by Language