Question
Implement the following program: 1) Define a class Director with two attributes name and numFilms. 2) Define an init function for Director which sets
Implement the following program: 1) Define a class Director with two attributes name and numFilms. 2) Define an init function for Director which sets the attribute value via input parameters. 3) Define a class Film with three attributes title, rating and director. 4) The Film attribute director is an object of type Director. 5) Define an init function for Film which sets the attribute values via input parameters. 6) Define a print function for Film which prints all attribute values. 7) Create an instance of Film with the values "Star Wars", "PG" and "George Lucas" and 20. 8) Call the Film print function. Example Output Movie Title : Star Wars Director George Lucas Rating: PG Num Films: 20
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres the implementation of the program described python class Director def initself name numFilms s...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Elementary Principles of Chemical Processes
Authors: Richard M. Felder, Ronald W. Rousseau
3rd Edition
978-0471687573, 9788126515820, 978-0-471-4152, 0471720631, 047168757X, 8126515821, 978-0471720638
Students also viewed these Algorithms questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App