Question: Exercise 7: Program exercise for Lists with Function Write a complete Python program including minimal comments (file name, your name, and problem description) that solves
Exercise 7: Program exercise for Lists with Function
Write a complete Python program including minimal comments (file name, your name, and problem description) that solves the following problem with the main function:
Problem Specification:
Write a program that reads a file that contains a list of player names and scores and find the best player and score. You need to use a loop to read all the values in the file.
Read a file called golf.txt as shown in the table.
Store player names in the list players, and scores in the list scores.
Count the number of players and the lowest score and the player who made the lowest score
Write a function called find_lowest which takes a list as an argument and return an integer which is the index of the lowest value in the list.
Create the following data file as shown below and test your program.
Make sure you have a main function and there should not be any global variable or statement other than the main function that is being called.
Sample RUN #1: There are 9 players in file golf.txt Player name score Jose Maria Olazabal 73 Vijay Singh 75 Sandy Lyle 73 Mike Weir 73 Larry Mize 79 Bubba Watson 69 Bernhard Langer 70 Adam Scott 72 Fred Couples 75 The winner is Bubba Watson with the score of 69 | Sample input: Jose Maria Olazabal 73 Vijay Singh 75 Sandy Lyle 73 Mike Weir 73 Larry Mize 79 Bubba Watson 69 Bernhard Langer 70 Adam Scott 72 Fred Couples 75 |

Exercise 7: Program exercise for Lists with Function Write a complete Python program including minimal comments (file name, your name, and problem description) that solves the following problem with the main function Problem Specification: Write a program that reads a file that contains a list of player names and scores and find the best player and score. You need to use a loop to read all the values in the file 1. Read a file called golf.txt as shown in the table 2. Store player names in the list players, and scores in the list scores. 3. Count the number of players and the lowest score and the player who made the lowest score 4. Write a function called find_lowest which takes a list as an argument and return an integer which is the index of the lowest value in the list. 5. Create the following data file as shown below and test your program. 6. Make sure you have a main function and there should not be any global variable or statement other than the main function that is being called Sample input: Jose Maria olazabal 73 Vijay Singh 75 Sandy Lyle 73 Mike Weir 73 Larry Mize 79 Bubba Watson 69 Bernhard Langer 70 Adam Scott 72 Fred Couples 75 Sample RUN #1: There are 9 players in file golf.txt Player name Jose Maria olazabal Vijay Singh Sandy Lyle Mike Weir Larry Mize Bubba Watson Bernhard Langer Adam Scott Fred Couples score 73 75 73 73 79 69 70 72 75 The winner is Bubba Watson with the score of 69 Programming Instruction
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
