class CoffeeMachine:
    def __init__(self, machine):
        self.machine = machine
        self.bean = 100

    def make_coffee(self, amount):
        if self.bean < amount:
            print("원두가 부족합니다")
        else:
            self.bean -= amount



coffee_machine = CoffeeMachine("커피커피")
coffee_machine.make_coffee(30)
coffee_machine.make_coffee(30)
coffee_machine.make_coffee(30)
print(coffee_machine.bean)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: