forked from kal179/Beginners_Python_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass_movies.py
More file actions
23 lines (19 loc) · 893 Bytes
/
class_movies.py
File metadata and controls
23 lines (19 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Movie:
def __init__(self, name, rating, director, budget, description):
self.name = name
self.rating = rating
self.director = director
self.budget = budget
self.description = description
def good_movie(self):
if self.rating >= 4:
return"Good Movie"
else:
return "Average Movie"
toy_story = Movie("ToyStory2" , 4 , "John Lasseter , Lee Unkrich , Ash Brannon" , "90 millon USD" , "When Woody is toy-napped by a greedy toy collector and is nowhere to be found, \nBuzz and his friends set out to rescue him.\nBut Woody too is tempted by the idea of becoming immortal in a museum.")
print("Title : " + toy_story.name)
print("Rating : " + str(toy_story.rating))
print("Director : " + toy_story.director)
print("Budget : " + str(toy_story.budget))
print("Description : " + toy_story.description)
print("Comment: " + toy_story.good_movie())