Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created December 12, 2019 12:21
Show Gist options
  • Save jasongorman/afc64e3625b3597b6cb0ebca09329e5b to your computer and use it in GitHub Desktop.
Save jasongorman/afc64e3625b3597b6cb0ebca09329e5b to your computer and use it in GitHub Desktop.
class Pricer(object):
def __init__(self, movieInfo):
self.movieInfo = movieInfo
def price(self, imdbID):
rating, title = self.movieInfo.fetch_movie_info(imdbID)
price = 3.95
if rating > 7:
price += 2.0
if rating < 4:
price -= 1.0
return Movie(imdbID, title, rating, price)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment