class Customer:
def __init__(self, name):
self.name = name
self.points = 0
def pay(self, amount):
self.points += int(amount * 0.01)
class VIPCustomer(Customer):
def pay(self, amount):
self.points += int(amount * 0.05)
def issue_coupon(self):
return f"{self.name}님 무료 쿠폰 발급 완료"
normal = Customer("일반")
vip = VIPCustomer("VIP")
normal.pay(10000)
vip.pay(10000)
print(f"일반 포인트: {normal.points}P / VIP 포인트: {vip.points}P 적립 완료.")
To embed this project on your website, copy the following code and paste it into your website's HTML: