Question
(e.6) The value of the inventory of a particular book is the price of that book times the number of copies we have in stock.
(e.6) The value of the inventory of a particular book is the price of that book times the number of copies we have in stock. Write a function called inventory_value that takes a Book as its argument and returns the value of our inventory of that book. Then write a function called lowest_value that takes a list of Books as its argument and returns the Book object (from the list) that has the lowest-value inventory. Finally, write a sequence of statements that prints a line in this form: The lowest-inventory-value book is "The Mythical Man-Month" by Fred Brooks at a value of $7.90. Note that the definition of a Book namedtuple has more fields in this lab compared to the previous lab. Here's my working data: Book=namedtuple ("Book", "author title genre year price in_stock") Book1 = Book ("Dan Brown", "The Da Vinci Code", "mystery", 2003, 27.44, 20000) Book2 = Book("Louisa May Alcott", "Little Women", "romance", 1868, 13.48, 78980) Book3 = Book("Mary Shelley", "Frankenstein", "sci-fi", 1818, 14.58, 28389) Book4 = Book("Stephen King", "It", "horror", 1986, 16.6, 80000) Book5 = Book("Arthur Miller", "The Crucible", "drama", 1953, 16.99, 6892) Book6 = Book("Dan Brown", "Origin", "Action and Adventure", 2017, 12.02, 92000 ) book_store_inventory=[Book1, Book2, Book3, Book4, Book5, Book6]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started