Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to check if an input is a string in python

#larryadah

only_number = input("Please type a number:
")
if only_number.isnumeric():
   print("It is an Integer")
else:#not being an integer means they are chances it's a floating number
   print("It is Not an Integer")
    
#larryadah
 
PREVIOUS NEXT
Tagged: #check #input #string #python
ADD COMMENT
Topic
Name
9+7 =