-
-
Save jasongorman/d36759b0d37d08b975239ddc2942eff7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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