Question: Write an algorithm and Python code necessary to solve the given problem statement.Problem Statement: Write a function read _ number that will read in the
Write an algorithm and Python code necessary to solve the given problem statement.Problem Statement: Write a function readnumber that will read in the data from a file. It will receive the name of the file as an argument, it will open the file for reading, and it will read the numbers in the file. Each number is separated with a blank space. It will return the list of numbers. Make sure that your function can handle any errors in the input file. If there is any nonnumerical data then it must ignore that data point.Write a function calcprod which will receive a list of numbers as an argument. It will calculate the product of all the numbers and will return the result.Write main function which will ask the user for name of the input file, it will call the readnumber function to read in the data from the input file, call the calcprod to calculate the product of numbers and will display the result.Example of input file: abc, Output from main: Product is: Note: abc in the input file will be ignored.
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
