Question: fix my code :Cannot find the following lable in output: bob smith Found output label but no corresponding output Cannot find the following lable in

fix my code :Cannot find the following lable in output: bob smith Found output label but no corresponding output Cannot find the following lable in output: paul phillips Found output label but no corresponding output Cannot find the following lable in output: molly brown Found output label but no corresponding output Exam 3_ test 20points Cannot find the following lable in output: jane stephens Found output label but no corresponding output Cannot find the following lable in output: paul phillips Found output label but no corresponding output Cannot find the following lable in output: bob smith Found output label but no corresponding output Cannot find the following lable in output: dave jones Found output label but no corresponding output Cannot find the following lable in output: molly brown Found output label but no corresponding output Exam 3_ test 30points Cannot find the following lable in output: molly brown Found output label but no corresponding output Cannot find the following lable in output: aaron nickle Found output label but no corresponding output Cannot find the following lable in output: john smith Found output label but no corresponding output Cannot find the following lable in output: jane stephens Found output label but no corresponding output Cannot find the following lable in output: bob smith Found output label but no corresponding output Exam 3_ test 40points Cannot find the following lable in output: molly brown Found output label but no corresponding output Cannot find the following lable in output: paul phillips Found output label but no corresponding output Cannot find the following lable in output: john smith Found output label but no corresponding output Cannot find the following lable in output: aaron nickle Found output label but no corresponding output Cannot find the following lable in output: jane stephens Found output label but no corresponding output Cannot find the following lable in output: dave jones Found output label but no corresponding output Exam 3_ test 50points Cannot find the following lable in output: dave jones Found output label but no corresponding output Cannot find the following lable in output: jane stephens Found output label but no corresponding output Cannot find the following lable in output: molly brown Found output label but no corresponding output Cannot find the following lable in output: bob smith Found output label but no corresponding output Cannot find the following lable in output: aaron nickle Found output label but no corresponding output Cannot find the following lable in output: john smith Found output label but no corresponding output Cannot find the following lable in output: paul phillips Found output label but no corresponding output My code:# Program Name: Exam 3. py # Resources Used: Python standard library ( file handling, sorting ). # Attempt to open the input file try: with open (" input . txt "," r ")as file: # Read all lines from the file into a list lines =file.readlines () except FileNotFoundError: # Handle the case where the file is not found print (" Error: The input file 'input.txt 'was not found. Please ensure it is in the same folder as this program." ) exit (1)# Exit the program with an error status # Print headers for the output print (" Name \ tDD \ tScore ") # Initialize variables to hold diver data diver _ name ="" dd =0 scores =[] # Process each line in the file for line in lines: # Strip leading / trailing whitespace line =line.strip () # If the line contains name and DD ( i . e .,first line for a diver )if line and len ( line . split ())>=2 : # Ensure the line has at least two parts ( name and DD )parts =line.split () # First part ( s )are the diver's name, the last part is the degree of difficulty diver _ name ="". join ( parts [ : -1])# All but the last part are the name try: dd =float ( parts [-1])# The last part is the DD except ValueError: print ( f " Invalid degree of difficulty found for diver { diver _ name } : { line }") continue # Skip this line if there's an error in DD # Reset scores for the next diver scores =[] # If the line contains scores ( after the first line, expect just scores )elif line: try: # Convert the line into a list of scores new _ scores =list ( map ( float ,line.split ())) # Add these scores to the scores list for the current diver scores.extend ( new _ scores ) except ValueError: print ( f " Invalid score data found for diver { diver _ name } : { line }") continue # Skip this line if there's an error in score conversion # You have been asked by the Olympic committee to write a program for scoring the Olympic diving events. In an Olympic diving event, each dive has a degree of difficulty (DD). The dives are evaluated by a panel of 7 judges who can award 0 to 10 points. Write a program that will read the data file named input.txt attached to this dropbox that contai-

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!