Files
live-campus-mcs-p-2027.2/Semaine_04/Bibliotheque/logic/actions.py
2026-01-15 16:52:26 +01:00

19 lines
510 B
Python

from classes import Book, Library
library = Library("Romanesque")
def register_book(title: str, author: str):
book = Book(title, author)
return library.add_new_book(book)
def list_titles() -> list[str]:
return [book.title for book in library.list_books_in_list()]
def delete_book(title: str):
return library.take_out_book(title)
def search_by_letter(letter: str):
return library.search_book_by_letter(letter)
def search_by_word(word: str):
return library.search_book_by_word(word)