Answers for "python split list in two"

0

python split list of tuples in two lists

>>> source_list = [('1','a'),('2','b'),('3','c'),('4','d')]
>>> list1, list2 = zip(*source_list)
>>> list1
('1', '2', '3', '4')
>>> list2
('a', 'b', 'c', 'd')
Posted by: Guest on December-19-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language