def main(): studentlines = read_input_file("students.txt")
This will require you to define a function called read_input_file that reads the lines of the specified file into a list (one element per line). You can borrow this code from previous labs.
You should make this a normal function, NOT a method of the Student class!
Linus 25 12 21 30 29However, we need to separate that into a name and a list of integer scores.
# Loop over the list of lines from the file and # break each line down into a name and scores for line in studentlines: # 1. Split line into a list. If list is empty, break out of the loop. # 2. The first item in the list is the student's name # 3. Convert the remaining items in the list into integers # 4. Create a new Student variable with that name and scores # 5. Call the Student print method to print that student's # information
Linus 25 12 21 30 29 23.4 Charlie 12 13 4 9.66667 Lucy 30 29 30 29.66667 Patty 13 14 15 12 13.5 Schroeder 28 21 24.5 Snoopy 21 21 21 21.0 Pigpen 15 15.0 Marcie 30 28 30 29.33333 Frieda 15 23 16 18.0 Spike 10 8 10 9.33333 Pooh 8 9 10 9.0 Piglet 24 23 28 25.0 Christopher 28 29 30 29.0 Owl 30 30 30 30.0 Rabbit 29 29 29 29.0 Eeyore 12 12 12 12.0 Kanga 30 29 30 29.66667 Roo 2 1 3 2.0 Tigger 0 0 0 0 0 30 5.0 Heffalump 21 22 23 22.0
Linus 25 12 21 30 29 23.4 Charlie 12 13 4 9.66667 Lucy 30 29 30 29.66667 Patty 13 14 15 12 13.5 Schroeder 28 21 24.5 Snoopy 21 21 21 21.0 Pigpen 15 15.0 Marcie 30 28 30 29.33333 Frieda 15 23 16 18.0 Spike 10 8 10 9.33333 Pooh 8 9 10 9.0 Piglet 24 23 28 25.0 Christopher 28 29 30 29.0 Owl 30 30 30 30.0 Rabbit 29 29 29 29.0 Eeyore 12 12 12 12.0 Kanga 30 29 30 29.66667 Roo 2 1 3 2.0 Tigger 0 0 0 0 0 30 5.0 Heffalump 21 22 23 22.0 Overall average: 19.30333