Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created April 10, 2021 08:23
Embed
What would you like to do?
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