-
-
Save jasongorman/04423791252e26bdb594e9ab35fd969b 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 CompactDisc(object): | |
def __init__(self, stock, price, payments: Payments): | |
self.payments = payments | |
self.price = price | |
self.stock = stock | |
def buy(self, quantity, credit_card): | |
self.stock -= quantity | |
self.payments.pay(credit_card, self.price) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment