python check if possible to convert to int code example
Example 1: python test if you can convert to int
if element.isdigit():
newelement = int(element)
Example 2: python test if you can convert to int
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False