Answers for "check user input for int python"

1

how to know if a input is a interger in python

inp = input('somrthing: ')

if inp.isnumeric():
    print('THat was a integer.')
else:
    print('That was not a integer.')
Posted by: Guest on September-15-2021

Python Answers by Framework

Browse Popular Code Answers by Language