user
You need to complete the following task:

Create a Python function to classify books according to genre.

def classify_books(book):

Answer:
assistant
def classify_books(book):
    if book.genre == "Fiction":
        return "Fiction"
    elif book.genre == "Mystery":
        return "Mystery"
    elif book.genre == "Science Fiction":
        return "Science Fiction"
    elif book.genre == "Romance":
        return "Romance"
    elif book.genre == "Fantasy":
        return "Fantasy"
    else:
        return "Other"