Need help to the answers below in Python language

User Generated

Wu518

Programming

Description

details are in the PDF file below.

#Note: there're students in my class using studypool, I need my code to be very different or I'll get zero in this assignment my instructor checks for similarity between all codes.

Unformatted Attachment Preview

Joy and Beauty of Data, Second Practicum – March 30, 2017 Name _______________________________________________________________ Question One. 25 points. Supply the missing function so that when this code runs: stranger_things = {} stranger_things["The Vanishing of Will Byers"] = "The Duffer Brothers" stranger_things["The Weirdo on Maple Street"] = "The Duffer Brothers" stranger_things["Holly, Jolly"] = "Shawn Levy" stranger_things["The Body"] = "Shawn Levy" stranger_things["The Flea and the Acrobat"] = "The Duffer Brothers" stranger_things["The Monster"] = "The Duffer Brothers" stranger_things["The Bathtub"] = "The Duffer Brothers" stranger_things["The Upside Down"] = "The Duffer Brothers" episodes_directed(stranger_things, "The Duffer Brothers") episodes_directed(stranger_things, "Shawn Levy") episodes_directed(stranger_things, "Kerri Cobb") The following output is produced: The Duffer Brothers directed 6 episodes Shawn Levy directed 2 episodes Kerri Cobb directed 0 episodes Question Two. 50 points. Supply the missing class and methods so that when this code runs: # “Stranger Things” is the title of the series. # “The Duffer Brothers” is the creator of the series. # 1 is the number of seasons that the series has run. # 8 is the number of episodes that the series contains. stranger_things = Series("Stranger Things", "The Duffer Brothers", 1, 8) print(stranger_things) stranger_things.addSeason() stranger_things.addEpisodes(9) print(stranger_things) # here comes the next season # there are now 9 more episodes The following output is produced: Stranger Things has aired 8 episodes over 1 seasons. Stranger Things has aired 17 episodes over 2 seasons. Question Three. 25 points. Object Oriented Concepts. (a) What is the name of the constructor method in a class? (b) Suppose the class Athlete is already defined and we want to define a new class called Runner that is a subclass of Athlete. Complete the following one line of Python: class Runner (c) In the context of the Athlete class, give a concrete example of the difference between an instance and an instance variable. (d) Describe briefly the difference between a reader method and a writer method. (e) To override the + operator, an __add__ method can be defined in a class. What method must be defined to override the ** operator?
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hello here is the solution, please inform in case of a comment

JOY AND BEAUTY OF DATA, SECOND PRACTICUM
STUDENT’S NAME
October 31, 2017

Question One: Functions
The following shows the missing method:
def episodes_directed(series, director):
count = 0
for episode, who in series.items():
if who == director:
count += 1
print(director, "directed", count, ...


Anonymous
I use Studypool every time I need help studying, and it never disappoints.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags