Semaine 4, jour 2
This commit is contained in:
36
Semaine_04/Bibliotheque/main.py
Normal file
36
Semaine_04/Bibliotheque/main.py
Normal 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))
|
||||
Reference in New Issue
Block a user