Menu
Coddy logo textTech

Challenge #2

Lesson 11 of 14 in Coddy's Dictionary in Python course.

challenge icon

Challenge

Easy

Create a function named search_book that allows you to search for a book in a library catalog by its title. The function should take the library catalog and a title as input and return the book's details (title, author, publication year, and availability) if the book is found. If the book is not in the catalog, the function should return a message indicating that the book is not found.

Try it yourself

def search_book(catalog, title):
    # Your code here

All lessons in Dictionary in Python