check if string can convert to int python code example
Example 1: python test if you can convert to int
if element.isdigit():
newelement = int(element)
Example 2: convert string to int python
my_string = "50485"
print(int(my_string))
if element.isdigit():
newelement = int(element)
my_string = "50485"
print(int(my_string))