Semaine 4, jour 3, soir

This commit is contained in:
gauvainboiche
2026-01-14 22:06:43 +01:00
parent 1db1a5ab8d
commit 4c9c3b29e8
11 changed files with 275 additions and 87 deletions

View File

@@ -1,36 +1,16 @@
from functions import \
add_new_book,\
take_out_book,\
list_books_in_list,\
sort_books_by_name,\
display_number_of_books,\
search_book_by_word,\
search_book_by_letter,\
save, load
from classes import Book, Library
books = []
library = Library("Romans")
for i in range(3):
new_book_title = input ("Quel livre ajouter ? > ")
new_book_title = input ("Quel livre ajouter ? > ")
new_book_author = input ("Qui l'a écrit ? > ")
new_book = {
"Title": new_book_title,
"Author": new_book_author
}
new_book_added = add_new_book(books, new_book)
print (new_book_added)
new_book = Book(new_book_title, new_book_author)
new_book_added = library.add_new_book(new_book)
print(new_book_added)
#print(take_out_book(books, new_book))
print(library.list_books_in_list())
sort_books_by_name(books)
print(list_books_in_list(books))
library.sort_books_by_name()
book_number = display_number_of_books(books)
print(f"La bibliothèque contient {book_number} livres.")
searching_word = input("Mot recherché > ")
print(search_book_by_word(books, searching_word))
searching_letter = input("Lettre recherchée > ")
print(search_book_by_letter(books, searching_letter))
print(library.list_books_in_list())