Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from video import Video
- class Pricer(object):
- def __init__(self, videoInfo):
- self.info = videoInfo
- def price(self, imdbID):
- response = self.info.fetch_video_info(imdbID)
- json = response.json()
- title = json["Title"]
- rating = float(json["imdbRating"])
- price = 3.95
- if rating > 7:
- price += 1.0
- if rating < 4:
- price -= 1.0
- return Video(imdbID, title, rating, price)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement