Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program contains three syntax or logic errors. Your challenge is to find these errors and fix them. # read-running-time s . py # Chapter 6.2
Program contains three syntax or logic errors. Your challenge is to find these errors and fix them.
# read-running-time s . py # Chapter 6.2 Page 258 def mainQ: # Open the video-times. txt file for reading. video_fileopen( video times.txt', "r' # Initialize an accumulator to 0.0 total -0.0 # Initialize a variable to keep count of the videos. count = 0 print('Here are the running times for each video:") # Get the values from the file and total them for line in video file # Convert a line to a float. run_timefloat(line]) # Add 1 to the count variable count += 1 # Display the time print( ' Video #', count, ': ', run-time, sep.') # Add the time to total total +count # Close the file video_file.closeC) # Display the total of the running times. print('The total running time is', total, "seconds. " # Call the main function main()Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started