Answers for "python check if possible to convert to int"

0

python test if you can convert to int

if element.isdigit():
  newelement = int(element)
Posted by: Guest on April-21-2020
0

python test if you can convert to int

def isfloat(value):
  try:
    float(value)
    return True
  except ValueError:
    return False
Posted by: Guest on April-21-2020

Code answers related to "python check if possible to convert to int"

Python Answers by Framework

Browse Popular Code Answers by Language