Question: Write a function that takes a list as a parameter, converts every element in the list to integar and then returns a tuple comprising of

Write a function that takes a list as a parameter, converts every element in the list to integar and then returns a tuple comprising of these integar elements. If the function encounters a character such as p' that cannot be converted to an integar, it throws this error message on the screen: "Error. Please enter only integers." Example Input: Enter elements of list separated by commas: 1,2,3,5 Output: Input: 1,2,d,5 Output: Error. Please enter only integers. Python 3.5 Code 1 function here #list-to-tuple 2 goes 4 - def main): alist input( Enter elements of list separated by commas: ".strip).split(',') list_to_tuple(a.list) 7 8 mainC Expand
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
