class Book:
def __init__(self, title):
self.title = title
self.is_rented = False
class Library:
def __init__(self):
self.fine_per_day = 500
def return_book(self, book, late_days, unpaid_fine):
if late_days > 0:
fine = late_days * self.fine_per_day
unpaid_fine += fine
print(f"{late_days}일 연체되었습니다. 연체료 {fine:,}원이 발생하며, 완납 전까지 대출이 제한됩니다.")
else:
print("정상 반납되었습니다.")
return unpaid_fine
library = Library()
book = Book("파이썬 기초")
unpaid = 0
unpaid = library.return_book(book, 3, unpaid)
To embed this project on your website, copy the following code and paste it into your website's HTML: