Question: Python is the programming language. Exercise 8: Program exercise for processing records in a file Write a complete Python program including minimal comments (file name,
Exercise 8: Program exercise for processing records in a file Write a complete Python program including minimal comments (file name, your name, and problenm description) that solves the following problem with the main function: Problem Specification Your program reads a file that contains a list of player names and scores and find the best player and the score. You need to use while-loop to read all the values for this problem 1. Read a file name which contains the values to read 2. Catch any problem opening the file. If a problem occurs, print an error message and exit. 3. Using a while-loop, count the number of players and the lowest score and the player who made the lowest score 4. Close the file 5. Make sure you have a main function and there should not be any global variable or statement other than main0 function call is used. 6. Create following data file as shown below and test your program SAMPLE RUN: Enter the name of the file to open for read: golf.txt 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 There are 9 players in file golf.txt The winner of this tournament 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
