Python: Add two given lists of different lengths, start from left
Add Lists from Left
Write a Python program to add two given lists of different lengths, starting on the left.
Sample Solution:
Python Code:
Sample Output:
Original lists: [2, 4, 7, 0, 5, 8] [3, 3, -1, 7] Add said two lists from left: [5, 7, 6, 7, 5, 8] Original lists: [1, 2, 3, 4, 5, 6] [2, 4, -3] Add said two lists from left: [3, 6, 0, 4, 5, 6]
Flowchart:
Python Code Editor:
Previous: Write a Python program to join two given list of lists of same length, element wise.
Next: Write a Python program to add two given lists of different lengths, start from right.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics