Question

Question 2:

Improve your library book management system to include the

following features:

Write a function borrow_book that takes a book ID. If the book is

available (in the library_books list), remove it from the list and add it to

a separate list called borrowed_books. However, If the book the user

wants to borrow is not in the library_books list, but is in the

borrowed_books list, then the user can request it. Requesting it

means that the book is added to a list called requested_books.

Example output: When the user successfully borrows a book, a

message similar to this one is shown to the user:

The book with the ID 001 is successfully loaned to you now.

When the user attempts to borrow a book that is currently loaned to

someone else, a message like this one is shown to the user:

The book with the ID 001 is not available right now. However, we

have requested it for you.

When the user attempts to borrow a book with an ID that does not

exist in the system, a message like this one is shown to the user:/nThe book with the ID 001 is not available right now. However, we

have requested it for you.

When the user attempts to borrow a book with an ID that does not

exist in the system, a message like this one is shown to the user:

The book with the ID 125 is unfortunately not available in the

system. Please re-check the ID.

Question image 1Question image 2