Lisa S. answered 03/01/23
Bachelors in Computer Science with 5+ Years of Teaching Experience
Hi Panhary!
Assuming that the input lists a and b are valid inputs and have the same length, we could make a new list to store our calculated differences and append to it. But since we cannot blindly believe that the inputs are valid, we need to error check them before we perform our operations.
We need to check that the lengths of our lists are the same, and that none of them are empty. Then, we need to check that each of the elements in our lists are numbers. So we have:
Please give this a thumbs up if it helped you :)