Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Last active October 4, 2019 06:47
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/d36759b0d37d08b975239ddc2942eff7 to your computer and use it in GitHub Desktop.
Save jasongorman/d36759b0d37d08b975239ddc2942eff7 to your computer and use it in GitHub Desktop.
class DailySongSales(object):
def __init__(self, all_sales, charts):
self.all_sales = all_sales
self.charts = charts
def sales_of(self, song):
song_sales = len(list(filter(lambda sale: sale.song == song, self.all_sales)))
self.charts.send(song, song_sales)
return song_sales
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment