def searchBooksByAuthor(self, author=None):
list_1 = [] # search book given the name and surname of the author
if author is None:
author_name = input("Give name and surname of the author: ")
for book in self.content:
if author_name in str(book):
list_1.append(book)
return print(f"The author: {author_name} has written: {lista}")
if __name__=="__main__":
bk = bs.searchBooksByAuthor()
if bk:
print("The books found are:")
for b in bk:
print("\t",b)
else: print("** There are no such books**")
TERMINAL:
Give name and surname of the author: Francois Chollet
The author: Francois Chollet has written: [
Book title: Deep Learning with Python from Francois Chollet (2017). Price: 30.2 ISBN: 1617284433]
** There are no such books** <------ WHY THIS POP UP ??? THANK YOU
i tries everything but i cant figure it out