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 test points 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 test points 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 test points 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 test points 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 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 filereadlines 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 # 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 scores # Process each line in the file for line in lines: # Strip leading trailing whitespace line linestrip # If the line contains name and DD i e first line for a diver if line and len line split : # Ensure the line has at least two parts name and DD parts linesplit # First part s are the diver's name, the last part is the degree of difficulty diver name join parts : # All but the last part are the name try: dd float parts # 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 linesplit # Add these scores to the scores list for the current diver scoresextend 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 judges who can award to points. Write a program that will read the data file named inputtxt attached to this dropbox that contai
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
