Solved Og in to Jupyterhub. (Refer to previous labs if you

Transcribed image text:

Og in to Jupyterhub. (Refer to previous labs if you have questions about how to log in.) ollow the instruction: a Create a source fie called ela17.py using the file editor in idle3. (Refer CLA2. Introduction to IDLE for how to use IDLE from Jupytemub) – To wrile a new Python program in IDLE, open a new python flie window. Clok. File-on the menu bar, then click New Lasncher, and finally click Python File inside the Others section. (Alternately you can click File on the menu bar, then click New and solect Python File) Problem Specification: – Include the following information as comments at the fop of your program (file name, your name, today’s date, short description of the program) – Your program should read a file that contains a list of golf player names and their scores, and should find the best player based on the score (lower is better in golf. – Create a file with contents as shown in Sample input File below – To create a data file – Click on the File menu bar, then click New Launcher, and finally click Text File inside the Others section. (Altemately you can click File on the menu bar, then click New and select Text File) * Copy paste the contents to the file – Click File – Save as, In the save as dialog box – Files of Type-select text file. Enter file name as golf.txt – save the file. – Read a file name as user input (which you created in the previous step – golf.tat) – Cateh any problem opening the file. If problem aceurs, print an error message and exit. – (Use Exception Handler, save the exception error message to exception object and priat the message) – You must use a whille-loop to read all the values from the golfitxt file. – Using while-toop, display the contents of the file (as shown in Sample input and Output below) – count the number of players – the winner is the player who made the lowest score. – Display the total number of players, Display the winner (player with lowest score) – Ciose the file. * Make sure you have a main function and there should not be any global variable or statement other than main0 function call is used. Sample inguit File: Jose Marla Olazabal 73 Vijay Singh
dose Maria Olazabal Vexy Singh 75 Sandy byle Mhe Weir Larry Mcee 19 Bubba Watson Be 6 Demhard Langer 70 Adam sooti 72 Fred Couples 75 Sample input and Output: Enter the name of the file to open for read; golf. txt Jose Maria Olazabal 73 Vijay singh 75 Sandy Ly le 73 Mike Weir 73 Larry Mite 79 Bubba Watson 69 Bernhard Langer 70 Adim seott 72 Fred Couples 75
Fred Couples 75 Sample input and Output: 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 Laxzy Mize 79 Bubba Watson 69 Bornhard Langex 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

Read more here: Source link