Question: Define a function named read_sum_odds ( fi lename) which takes a filename as a parameter. The function reads numbers from the file line by line

 Define a function named read_sum_odds ( fi lename) which takes a

Define a function named read_sum_odds ( fi lename) which takes a filename as a parameter. The function reads numbers from the file line by line and calculates the sum of all the odd numbers per line. The function returns a list of sums. For example, if a text file contains the following numbers: then the function returns [15,45,13]. Note: the function should convert each element into an integer in order to calculate the total. You can assume that the file is a plain text file and only contains valid integers. For example

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 Databases Questions!