Append numbers at same position in strings: Difference between revisions
Append numbers at same position in strings (view source)
Revision as of 18:53, 10 November 2021
, 2 years agoPython example
mNo edit summary |
m (Python example) |
||
Line 63:
{11019,21120,31221,41322,51423,61524,71625,81726,91827}{11019,21120,31221,41322,51423,61524,71625,81726,91827}
</pre>
=={{header|Python}}==
<lang python>from functools import reduce
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(lambda x, y: x + y, [str(n) for n in z]) for z in zip(list1, list2, list3)))
</lang>{{out}}['11019', '21120', '31221', '41322', '51423', '61524', '71625', '81726', '91827']
=={{header|Raku}}==
|