Feb-17-2020, 11:40 PM
For each line item eg.
-48.9701217110874,5.67558617156734,0
, you can use split() to turn it to a list. Then delete last item. Then use list comprehension to make a new list of floats. line_item = "-48.9701217110874,5.67558617156734,0" new_item = list(line_item.split(",")) del new_item[-1] coordinate = [float(num) for num in new_item] print(coordinate) print(type(coordinate[1]))