Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python split tuples into 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')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #split #tuples #lists
ADD COMMENT
Topic
Name
8+6 =