Sumar dos listas elemento por elemento
rahim
-
S -
S -
Bonjour,
You're starting with Python
My question is as follows:
I have two lists
L1 = [1, 2, 3] with 3 elements
L2 = [4, 5, 6, 7] with 4 elements
I want to add them element by element to get
L1 [1, 2, 3]
+
L2 [4, 5, 6, 7]
-----------------------
L3 = [5, 7, 9, 7]
column by column from left to right even if my two lists are of different lengths.
How to do ?
Thank you
You're starting with Python
My question is as follows:
I have two lists
L1 = [1, 2, 3] with 3 elements
L2 = [4, 5, 6, 7] with 4 elements
I want to add them element by element to get
L1 [1, 2, 3]
+
L2 [4, 5, 6, 7]
-----------------------
L3 = [5, 7, 9, 7]
column by column from left to right even if my two lists are of different lengths.
How to do ?
Thank you