Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python Blart and finish values must be integers Problem 3: sum_column(file_name, column) - returns total for column Write a function that takes 2 parameters: 1.

image text in transcribed
python
Blart and finish values must be integers Problem 3: sum_column(file_name, column) - returns total for column Write a function that takes 2 parameters: 1. file_name - the name of a data file to read 2. column - the index to which column in the data file to sum The function attempts to read the file and sum up the specified column. For example, if the function was called as sum_column("data3.txt", 2) And the contents of data3.txt was 10 23 44 12 0912 The function would return 66 (the sum of 44 and 12, the numbers found in column 2 of the file. More examples >>> sum_column('columns.txt', 0) 151.0 >>> sum_column('columns.txt', 2) 182.0 >>> sum_column ('columns.txt', 4) Column out of range 0 >>> sum_column('xcolumns.txt', 4)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Deductive And Object Oriented Databases Second International Conference Dood 91 Munich Germany December 18 1991 Proceedings Lncs 566

Authors: Claude Delobel ,Michael Kifer ,Yoshifumi Masunaga

1st Edition

3540550151, 978-3540550150

More Books

Students also viewed these Databases questions

Question

What is the principle of thermodynamics? Explain with examples

Answered: 1 week ago

Question

Explain the strength of acid and alkali solutions with examples

Answered: 1 week ago

Question

Describe your ideal working day.

Answered: 1 week ago