Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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 6. Make sure you have a main function and there should not be any gl test your program. obal variable or statement other than the main function that is being called. Sample RUN 1: Sample input: Jose Maria olazabal There are 9 players in file golf.txt vijay singh 75 Player name Jose Maria olazabal Vijay singh Sandy Lyle Mike Weir Larry Mize Bubba Watson Bernhard Langer Adam Scott Fred Couples Sandy Lyle 73 73 73 79 69 70 72 75 tarry Nize 79 Dubba Watson Bernhard Langer 70 72 fred Couples 75 The winner is Bubba Watson with the score of 69 Programming Instruction 1. Create a file called 2. Type the program in the exercise 15p7.py window, while making sure you put minimal comments exercise15p7.py using the file editor in idle3 and the main function as in the previous programs. 3. Save the changes as exercise15p7.py 4. Create data file called golf.txt as shown in the table. 5. Run your prorm:FS>function key to execute the Enter the values shown above 6. If you have any error, fix the error and save the change. 7. Check for correct answers as in the sample runs above. There is only one programming exercise for this lab. Create a script log as in the previous lab and turn in the hardcopy of the script log to your lab assistant. The number of execution for this program is one as seen above

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

Step: 3

blur-text-image

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

The Database Factory Active Database For Enterprise Computing

Authors: Schur, Stephen

1st Edition

0471558443, 9780471558446

More Books

Students also viewed these Databases questions