Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created April 6, 2019 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/9ad5e4ae9240e7275014c3d7e047ee63 to your computer and use it in GitHub Desktop.
Save jasongorman/9ad5e4ae9240e7275014c3d7e047ee63 to your computer and use it in GitHub Desktop.
from video import Video
class Pricer(object):
def __init__(self, imdb_api):
self.api = imdb_api
def price(self, imdbID):
rating, title = self.api.fetch(imdbID)
price = 3.95
if rating > 7:
price += 1.0
if rating < 4:
price -= 1.0
return Video(imdbID, title, rating, price)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment