Question
i need these 2 question written in python.

---- US ). T R . Now for every episode of the 7 seven episodes of season 7. Your program has to ask the following questions a
0 0
Add a comment Improve this question Transcribed image text
Answer #1

# Please refer to the screenshot for the indentation of the code and also an output screenshot is there.

epiNumber = [0 for i in range(7)] # Initialisation of array containing episode number
epiTitle = ["" for i in range(7)] # Initialisation of array containing episode title
epiDirector = ["" for i in range(7)] # Initialisation of array containing name of episode director
epiViewers = [0 for i in range(7)] # Initialisation of array containing number of US viewers for the episode
epiIMDO = [0.0 for i in range(7)] # Initialisation of array containing episode's IMDO rating
epiHigher = [] # Initialisation of array containing episodes with IMDO rating of 9.2 or higher
avgViewers = 0 # Initialisation of average number of viewers
for i in range(7):
epiNumber[i] = int(input("Enter the episode number : "))
epiTitle[i] = str(input("Enter the episode title : "))
epiDirector[i] = str(input("Enter the name of episode director : "))
epiViewers[i] = float(input("Enter the number of US viewers (in millions) for this episode : "))
epiIMDO[i] = float(input("Enter the episode's IMDO rating : "))
avgViewers += epiViewers[i]
if (epiIMDO[i] >= 9.2):
epiHigher.append(i)
avgViewers = avgViewers/7
avgViewers = round(avgViewers, 2)
print ('The average number of US viewers per whole season is ' + str(avgViewers) + ' (in millions)')
numHigher = len(epiHigher)
print (str(numHigher) + ' episodes have IMDO rating of 9.2 or higher. They are :')
if (len(epiHigher)>0):
for i in range(len(epiHigher)):
print (epiTitle[epiHigher[i]])

epiNumber = [O for i in range (7)] # Initialisation of array containing episode number epititle = [ for i in range (7)] # I

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) (MSC v.1916 64 bit (AMD64)] on win32 Type help, copyright, c

Add a comment
Know the answer?
Add Answer to:
i need these 2 question written in python. ---- US ). T R . Now for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Web Series Renamer & Regular Expression

    Using Regex is mandatoryA sample set of srt+mp4 is given to you in separate folders. You need to rename mp4 + srt files. You know that in VLC/any media play will auto-include the srt if the filename and srt name is same. There shall be two folders. wrong srt - containing pre-renamed file name corrected srt - after rename, ensure that new filenames are placed here. You need to ask 3 inputs from the users Initially make a menu based program...

  • For Python-3 I need help with First creating a text file named "items.txt" that has the...

    For Python-3 I need help with First creating a text file named "items.txt" that has the following data in this order: Potatoes Tomatoes Carrots. Write a python program that 1. Puts this as the first line... import os 2. Creates an empty list 3. Defines main() function that performs the tasks listed below when called. 4. Put these two lines at the top of the main function... if os.path.exists("costlist.txt"): os.remove("costlist.txt") Note: This removes the "costlist.txt" file, if it exists. 5....

  • Could anyone help add to my python code? I now need to calculate the mean and...

    Could anyone help add to my python code? I now need to calculate the mean and median. In this programming assignment you are to extend the program you wrote for Number Stats to determine the median and mode of the numbers read from the file. You are to create a program called numstat2.py that reads a series of integer numbers from a file and determines and displays the following: The name of the file. The sum of the numbers. The...

  • I really need help with this python programming assignment Program Requirements For part 2, i need...

    I really need help with this python programming assignment Program Requirements For part 2, i need the following functions • get floats(): It take a single integer argument and returns a list of floats. where it was something like this def get_floats(n):   lst = []   for i in range(1,n+1):     val = float(input('Enter float '+str(i)+': '))     lst.append(val)   return lst • summer(): This non-void function takes a single list argument, and returns the sum of the list. However, it does not use...

  • Hi, I need some help with the following question. I need the answer in Python please....

    Hi, I need some help with the following question. I need the answer in Python please. 10.23 LAB: Warm up: People's weights (Lists) (1) Prompt the user to enter four numbers, each corresponding to a person's weight in pounds. Store all weights in a list. Output the list. (2 pts) Ex: Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 176.0 Enter weight 4: 166.3 Weights: [236.0, 89.5, 176.0, 166.3] (2) Output the average of the list's elements...

  • Need a program in python. Asterix and Obelix want to store and process information about movies...

    Need a program in python. Asterix and Obelix want to store and process information about movies they are interested in. So, you have been commissioned to write a program in Python to automate this. Since they are not very computer literate, your program must be easy for them to use. They want to store the information in a comma separated text file. Using this they would need to generate a report – see all items AND show a bar chart...

  • Case Study Baseball Team Manager. CMSC 135 Python Chapter 7 Assignment: Use a file to save...

    Case Study Baseball Team Manager. CMSC 135 Python Chapter 7 Assignment: Use a file to save the data Update the program so it reads the player data from a file when the program starts andwrites the player data to a file anytime the data is changed What needs to be updated: Specifications Use a CSV file to store the lineup. Store the functions for writing and reading the file of players in a separate module than the rest of the...

  • I need the pseudocode and python for the four attached problems: 1. (Chapter 5 - For...

    I need the pseudocode and python for the four attached problems: 1. (Chapter 5 - For Loop) Logic Technical College has a current tuition of $10,000 per year. Tuition is scheduled to increase by 5% each year. Using a FOR loop, design a program that calculates and displays the tuition each year for the next ten years, like so: The tuition for year 1 will be: 10500.00 The tuition for year 2 will be: 11025.00 ……….. (You, of course will...

  • I need this python program to access an excel file, books inventory file. The file called...

    I need this python program to access an excel file, books inventory file. The file called (bkstr_inv.xlsx), and I need to add another option [search books], option to allow a customer to search the books inventory, please. CODE ''' Shows the menu with options and gets the user selection. ''' def GetOptionFromUser(): print("******************BookStore**************************") print("1. Add Books") print("2. View Books") print("3. Add To Cart") print("4. View Receipt") print("5. Buy Books") print("6. Clear Cart") print("7. Exit") print("*****************************************************") option = int(input("Select your option:...

  • I need help with this assignment in C++, please! *** The instructions and programming style detai...

    I need help with this assignment in C++, please! *** The instructions and programming style details are crucial for this assignment! Goal: Your assignment is to write a C+ program to read in a list of phone call records from a file, and output them in a more user-friendly format to the standard output (cout). In so doing, you will practice using the ifstream class, I'O manipulators, and the string class. File format: Here is an example of a file...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT