Assume, you have been given a tuple with details about books that won the Good Reads Choice Awards.
book_info = (
("Best Mystery & Thriller","The Silent Patient",68821),
("Best Horror","The Institute",75717),
("Best History & Biography","The five",31783 ),
("Best Fiction","The Testaments",98291)
)
Write a Python program that prints the award category, the book name, and its total votes earned as shown below.
book_info = (
("Best Mystery & Thriller","The Silent Patient",68821),
("Best Horror","The Institute",75717),
("Best History & Biography","The five",31783),
("Best Fiction","The Testaments",98291))
for book in book_info:
print(f"{book[1]} won the '{book[0]}' category with {book[2]} votes")
Comments
Leave a comment