Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. from video import Video
  2.  
  3.  
  4. class Pricer(object):
  5.  
  6. def __init__(self, videoInfo):
  7. self.info = videoInfo
  8.  
  9. def price(self, imdbID):
  10.  
  11. response = self.info.fetch_video_info(imdbID)
  12.  
  13. json = response.json()
  14.  
  15. title = json["Title"]
  16. rating = float(json["imdbRating"])
  17.  
  18. price = 3.95
  19.  
  20. if rating > 7:
  21. price += 1.0
  22.  
  23. if rating < 4:
  24. price -= 1.0
  25.  
  26. return Video(imdbID, title, rating, price)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement