Library Book Tracker – Difficult

Challenge Title: “Library Book Tracker”

Objective: Build a simple system to manage books in a library.
Problem Description
You are tasked with creating a Python program that simulates a basic library book tracking system. The system should allow users to:

Add a book to the library.
Remove a book from the library.
Search for a book by title.
Display all books currently in the library.
Each book should be represented as a dictionary with the following keys:

“title”: string
“author”: string
“year”: integer
The library itself should be a list of book dictionaries.

Requirements
Create the following functions:

add_book(library, title, author, year)
Adds a new book to the library.

remove_book(library, title)
Removes a book by title. If the book is not found, print a message.

search_book(library, title)
Searches for a book by title and returns the book details if found.

display_books(library)
Displays all books in the library in a readable format.

Scroll to Top