Question: 3 . Define a list list 1 = [ 1 2 , 3 5 . 8 , - 9 , 2 3 , - 1
Define a list list Next, for each line of the file infileAQtxt do the following:
a Remove any whitespace characters at the end of the line and convert to an integer
n and print the value of n
b If n set i n; otherwise set i n
c Print listi with a suitable message.
d Print listi with a suitable message.
If any exceptions occur, print the default error message for the exception. For ValueError also print a custom message in addition to the default error message, then continue with the next item in the file
infileAQtxt contains following text:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
