Semaine 4, jour 3, soir
This commit is contained in:
@@ -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())
|
||||
Reference in New Issue
Block a user