Question: Repeat exam 1 below with using try - except clause to handle ( print a message to the user ) these number of exceptions below:

Repeat exam 1 below with using try-except clause to handle (print a message to the user) these number of exceptions below:
Use this list of numbers: x =[spam,30,40,20], y =[10,20,30,40], z =[spam,50,20,20]
1. ZeroDivisionError
2. NameError
3. TypeError
4. ValueError
Exam 1
Write a function that receives three lists of numbers of any length and returns all unique pairs of numbers where their sum is equal to a target value determined by a function parameter. Pairs of the same number are not allowed. Use the lists and target value below
In order to write this function, we will break it down this way:
(1) Write a function that receives a list of numbers of any length and returns all unique pairs of numbers where their sum is equal to a target value determined by a function parameter. Pairs of the same number are not allowed. Apply this function to all lists and target value below.
(2) Write a function that receives two lists of numbers of any length and returns all unique pairs of numbers, each from each list, where their sum is equal to a target value determined by a function parameter. Pairs of the same number are not allowed. Apply this function to all lists and target value below.
(3) Write a function that receives three lists of numbers of any length and returns all unique pairs of numbers, each from each list, where their sum is equal to a target value determined by a function parameter. Pairs of the same number are not allowed. Apply this function to all lists and target value below.
(4) Write a function that calls the three functions above and return all their outputs. This function will do the task that we want above. Apply this function to all lists and target value below.
Sample of the solution: Use these lists and this target value in your code
Target value for each function: t =70

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!