Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a code in phyton for PART 4. Part 1: Enter the titles for the videos in your channel Assume your channel is empty. Write

Write a code in phyton for PART 4.

Part 1: Enter the titles for the videos in your channel Assume your channel is empty.

Write code to allow the user to enter the titles of the videos to be added to the channel.

The user should be able to add as many as they want to.

Then print the titles in the channel so that you can see all of them at once.

image text in transcribed

Part 2: Set a length for your videos, and run some computations For each video, ask the user to give you a length in minutes for that video. Videos are measured in minutes, and these can have decimal components (like 3.5 minutes). Once the user has entered a length for each video, compute and show them the length of the shortest video, the length of the longest video, and the average video length. Your channel is very particular, so you want the average length to be displayed with exactly 3 decimal points of precision.

image text in transcribed

Part 3: Bring in your subscribers In this part of the project, youll compute how much time your subscribers spent watching your videos. Ask the user to tell you how many subscribers your channel has. For each subscriber, randomly choose one of the videos in your channel (its ok to choose the same video multiple times) to have them watch. Show the total amount of time spent between all the videos that all subscribers watched, as well as which videos were watched by your subscribers (dont show duplicated here!).

image text in transcribed

Part 4: Compare your channel to your competitor Assume your competitor has a random amount of subscribers (between 1 and 100). Compute the amount of subscribers for your competitor (since its random, this should vary each time!).

Each of their subscribers watches 1 video on their channel that is between 1 and 5 minutes long (choose this randomly per subscriber!).

Compute the total amount of minutes your competitors subscribers spent watching their channel.

Finally, figure out which channel had more watch time! Output whether it was your channel, their channel, or a tie! To make sure that youre correct, output the total time watched for each channel.

Type a code for part 4 in phyton.

\# Empty list to store the video titles videos =[] \# Continuously ask the user for video titles until they stop while True: title = input("Enter the title of the video (or type ' q ' to quit): ") if title == 'q': break videos.append(title) \#rint the titles in the channel print("\TTitles in the channel:") for title in videos: print(title)

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

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

Connect with your audience

Answered: 1 week ago