by maxk
Dec 4, 2014
hey guys! i want to merge two lits alternating... list1 = [0,2,4,6]
list2 = [1,3,5]
??how would the merging-script (python) look like??
(deisred): merge_list =[0,1,2,3,4,5,6]
thank you guys!
Hello maxK,
I am nor sure whether my solution is good for you to learn. But is only 3 lines of code. See the attached.
best,
M.
EDIT: Now that I think about it, ignore my solution. It complicates things. Djordje's one is more appropriate for your progress
Dec 5, 2014
Any reason for using python on this task?
There's a native component for exactly that task.
All you need is Weave.
It puts together two lists in alternating fashion or according to a pattern, similar to an inverse of the Dispatch component.
Jul 27, 2016
Cancel
Marios Tsiliakos
Hello maxK,
I am nor sure whether my solution is good for you to learn. But is only 3 lines of code. See the attached.
M.
EDIT: Now that I think about it, ignore my solution. It complicates things. Djordje's one is more appropriate for your progress
Dec 5, 2014
Hannes Löschke
Any reason for using python on this task?
There's a native component for exactly that task.
Dec 5, 2014
Ralph Zoontjens
All you need is Weave.
It puts together two lists in alternating fashion or according to a pattern, similar to an inverse of the Dispatch component.
Jul 27, 2016