Semaine 4, jour 2

This commit is contained in:
gauvainboiche
2026-01-14 10:21:12 +01:00
parent aad907f110
commit 4911bbd40c
32 changed files with 912 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
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
books = []
for i in range(3):
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)
#print(take_out_book(books, new_book))
sort_books_by_name(books)
print(list_books_in_list(books))
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))