Q: Kevin is a freelance video producer who makes TV commercials for local businesses. When he makes a commercial, he usually films several short videos. Later, he puts these short videos together to make the final commercial. He has asked you to write the following two programs. 1. A program that allows him to enter the running time (in seconds) of each short video in a project. The running times are saved to a file. 2. A program that reads the contents of the file, displays the running times, and then displays the total running time of all the segments.
I Would like to know the proper and correct python code for the following problem. described below
I did get an answer but I believe its wrong (attached as the images)
Q: Kevin is a freelance video producer who makes TV commercials for local businesses. When he makes a commercial, he usually films several short videos. Later, he puts these short videos together to make the final commercial. He has asked you to write the following two programs.
1. A
2. A program that reads the contents of the file, displays the running times, and then displays the total running time of all the segments.
![> Run
O Debug
Stop
E Share H Save
{) Beautify
Language Python 3
videos Time txt
file = open('videosTime.txt','r')
2 print('Time stamps are:')
3 print(file.read())
file.close()
main.py
input
Time stamps are:
4
6
10
...Program finished with exit code 0
Press ENTER to exit console.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fdda8917b-cf06-48d9-8194-ba87bdf60318%2F3ce3a84f-06c0-41f1-b6ca-514322122825%2Flviu3is_processed.jpeg&w=3840&q=75)
![Run
O Debug
Stop
E Share H sSave
{} Beautify
Language Python 3
main.py
videos Time txt !
1 file = open('videosTime.txt', 'w')
2 print('Enter time stamps and enter exit to exit the program')
3- while True:
inp = input ()
if inp == 'exit':
4.
5.
break
(inp)
(time) + '\n')
9 print('Time stamps successfully added...")
time
file.write(
7.
10
file.close()
11
input
Enter time stamps and enter exit to exit the program
4
10
exit
Time stamps successfully added...
...Program finished with exit code 0
Press ENTER to exit console.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fdda8917b-cf06-48d9-8194-ba87bdf60318%2F3ce3a84f-06c0-41f1-b6ca-514322122825%2Fe09qqsm_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)