class Account:
def __init__(self, name, balance, limit):
self.name = name
self.balance = balance
self.limit = limit
def withdraw(self, amount):
if amount > self.balance or amount > self.limit:
print("출금 불가")
return
self.balance -= amount
print(f"{amount}원 출금 완료. 잔액: {self.balance}원")
def transfer(self, target_account, amount):
if amount > self.balance:
print("이체 불가")
return
self.balance -= amount
target_account.balance += amount
print(f"{amount}원 이체 완료")
account1 = Account("홍길동", 10000, 5000)
account2 = Account("김철수", 5000, 5000)
account1.withdraw(6000)
account1.transfer(account2, 3000)
print("홍길동 잔액:", account1.balance)
print("김철수 잔액:", account2.balance)
To embed this project on your website, copy the following code and paste it into your website's HTML: