class Book:
def __init__(self, title, author, genre):
self.title = title
self.author = author
self.genre = genre
self.borrowed = False
def borrow(self):
if self.borrowed:
print("This book is already borrowed.")
else:
self.borrowed = True
print(f"The book '{self.title}' has been marked as borrowed.")
def return_book(self):
if not self.borrowed:
print("This book is not currently borrowed.")
else:
self.borrowed = False
print(f"The book '{self.title}' has been marked as returned.")
# Creating two book objects
book1 = Book("The Great Gatsby", "F. Scott Fitzgerald", "Fiction")
book2 = Book("To Kill a Mockingbird", "Harper Lee", "Classic")
# Borrowing and returning books
book1.borrow()
book1.return_book()
book2.borrow()