Question: Write a program for a library to manage books. 1. Create a dictionary with 10 books a. Book dictionary should contain the following 2
Write a program for a library to manage books. 1. Create a dictionary with 10 books a. Book dictionary should contain the following 2 values 1. Number of books available 2. Age limit to read the book I.e. "The Jungle Book" [10, 25] b. Write a while loop to run this program again and again 2. Ask the user what book they would like to read. 3. Check if the book is available. Note: add a condition in your program to update the number of books available in the dictionary i.e.: let's say the number of books available = is 25 and every time the user used that book, it should update to 25-1 if the book value is 0, this means the book is unavailable 4. if the book is available, get the user's age. Note: add a condition to match the age in the dictionary and the user-provided age. a. if age is passed, print a message "enjoy the book" b. if age is not passed, print a message "Your age limit is not permitted to read this try something else" c. if the book is not available print a message "sorry {book name} is not available, please try again."
Step by Step Solution
3.51 Rating (158 Votes )
There are 3 Steps involved in it
Answer Heres a Python program that should accomplish this Creating a dictionary with 10 books The ke... View full answer
Get step-by-step solutions from verified subject matter experts
