Answer the question
In order to leave comments, you need to log in
How to split 1 list by 2?
There is a list:
points = ["42.07, 48.29", "42.81, 132.87", "42.82, 47.12", "42.88, 47.64", "42.98, 47.5"]
point1 = ["42.07", "42.81", "42.82", "42.88", "42.98" ]
point2 = ["48.29", "132.87", "47.12", "47.64" ,"47.5"]
Answer the question
In order to leave comments, you need to log in
points = ["42.07, 48.29", "42.81, 132.87", "42.82, 47.12", "42.88, 47.64", "42.98, 47.5"]
point1, point2 = list(), list()
for point in points:
p1, p2 = point.split(',')
point1.append(p1.strip())
point2.append(p2.strip())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question