Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In PYTHON Write a function add list (lstl, lst2) that takes two lists of numbers of the same length and returns a list consisting of
In PYTHON
Write a function add list (lstl, lst2) that takes two lists of numbers of the same length and returns a list consisting of the sum of the first numbers, the sum of the second numbers, etc. For example add_list ([1,2,3], [4,5, 6]) should return the list [5, 7, 9] since 1+ 4 is 5, 2 +5 is 7, etc. Your main program should prompt user for input. It should read a list of numbers, one number per line, followed by "done", then another list of numbers, one per line, followed by done. If the lists have different lengths, your main program should print "Lists are different lengths." If they are the same length, the main program should call add ?1st and print the resulting list, one number per line Note: you may define additional functionsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started