Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedProgram 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

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

Transactions On Large Scale Data And Knowledge Centered Systems Xxiv Special Issue On Database And Expert Systems Applications Lncs 9510

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Hendrik Decker ,Lenka Lhotska ,Sebastian Link

1st Edition

366249213X, 978-3662492130

More Books

Students also viewed these Databases questions