Append numbers at same position in strings: Difference between revisions

m
(added AWK)
Line 201:
 
=={{header|Python}}==
<lang python>fromlist1 functools= import[1, reduce2, 3, 4, 5, 6, 7, 8, 9]
 
list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9]
list2 = [10, 11, 12, 13, 14, 15, 16, 17, 18]
list3 = [19, 20, 21, 22, 23, 24, 25, 26, 27]
 
print(list([
reduce''.join(lambda x, y: x + y, [str(n) for n in z]) for z
in zip(list1, list2, list3)
)])</lang>
{{out}}
<pre>['11019', '21120', '31221', '41322', '51423', '61524', '71625', '81726', '91827']</pre>
Anonymous user