Avatar ·

Elepenstate addition of lists of various lengths

📁 python

There are two lists:

  a = [ 1 ,  2 ,  3 ] b = [ 4 ,  5 ,  6 ,  7 ,  8 ]     

you need to get the following result:

  a + b = [ 5 ,  7 ,  9 ,  7 ,  8 ]     

I hope the meaning is clear. It's just that there are only crutches in my head, I would like to find a more or less adequate solution.