Question: Copy your Person class from question 5 into a new program. Include in the class the _ _ str _ _ method you added when
Copy your Person class from question into a new program. Include in the class the str method you added when carrying out the exercise in the info panel before question
Add after the class a function readpeoplecsvfilename that takes as a parameter the name of a CSV file of person data and returns a list of Person objects, one for each line in the input file and in the same order The function should only require lines, excluding comments and blank lines. The maximum function length is set to statements for this question; if you find yourself using more than that, please ask a tutor for help.
The input CSV file will contain columns:
a name not containing a comma
an integer age in years
a float weight in kg
a float height in metres
For example, the file peoplecsv used in the example below contains the following:
Peter Piper,
Polly Perkins,
Griselda Gribble,
Ivan Ng
Lucy Lovelorn,
Leslie McWhatsit,
You may assume the given file exists and is in the correct format you're not expected to handle any errors.
Paste your complete Person class definition plus your readpeople function but do not include any test code.
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
