+ 3
Help with a code
How do you turn this... x="A 16,B 17,C 18" into this?... z=[["A","16"],["B","17"],["C","18"]] This attached code is my try. It'll explain a bit more. https://code.sololearn.com/czruZCa4PX53/?ref=app
2 Answers
+ 5
https://code.sololearn.com/cg4zP3pNU7ve/?ref=app
Now?
+ 3
List comprehension is also possible:
y = [u.split(" ") for u in x.split(",")]