Skip to content

Instantly share code, notes, and snippets.

@jasongorman

jasongorman/compact_disc.py Secret

Created Apr 10, 2021
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