how to check integer in string python code example
Example 1: python test if string is int
'16'.isdigit()
>>>True
'3.14'.isdigit()
>>>False
'Some text'.isdigit()
>>>False
Example 2: python is integer
(1.23).is_integer() # Returns false
'16'.isdigit()
>>>True
'3.14'.isdigit()
>>>False
'Some text'.isdigit()
>>>False
(1.23).is_integer() # Returns false