I want to convert
list_int=['(2,3)','(3,4)']
to integer coordinate points:
[(2, 3), (4, 8)]
I tried this code
list_int=['(2,3)','(3,4)']
for x in list_int:
con= int(x0 for x in list_int)
print con
and I am getting this error
TypeError: int() argument must be a string or a number, not 'generator'
I am new to Python.
I'd remove the start and end parenthesis, split each string, and then convert each element to an int
:
result = [[int(x) for x in s[1:-1].split(",")] for s in list_int]
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments