0
0
No-Codeknowledge~30 mins

Search and filtering in No-Code - Mini Project: Build & Apply

Choose your learning style9 modes available
Search and Filtering
📖 Scenario: You are organizing a small library of books at home. You want to find books quickly by searching their titles or filtering by genre.
🎯 Goal: Build a simple search and filtering system that helps you find books by title keywords and genre.
📋 What You'll Learn
Create a list of books with title and genre
Add a variable to hold the search keyword
Filter the list of books by the search keyword in the title
Add a filter to select books by genre
💡 Why This Matters
🌍 Real World
Search and filtering help you quickly find information in lists, like books, contacts, or products.
💼 Career
Understanding search and filtering is essential for data handling, user interfaces, and improving user experience in many jobs.
Progress0 / 4 steps
1
Create the list of books
Create a list called books with these exact entries as dictionaries: {'title': 'The Hobbit', 'genre': 'Fantasy'}, {'title': '1984', 'genre': 'Dystopian'}, {'title': 'To Kill a Mockingbird', 'genre': 'Classic'}, {'title': 'The Great Gatsby', 'genre': 'Classic'}, and {'title': 'Brave New World', 'genre': 'Dystopian'}.
No-Code
Need a hint?

Use a list of dictionaries where each dictionary has keys 'title' and 'genre'.

2
Add the search keyword variable
Create a variable called search_keyword and set it to the string 'the' (all lowercase).
No-Code
Need a hint?

Set the variable exactly as search_keyword = 'the'.

3
Filter books by title containing the search keyword
Create a list called filtered_books that contains only the books from books where the search_keyword appears in the book's title (case insensitive). Use a list comprehension with book as the iterator variable.
No-Code
Need a hint?

Use book['title'].lower() to check the title in lowercase.

4
Add genre filtering to the search
Create a variable called selected_genre and set it to 'Classic'. Then update filtered_books to include only books where the title contains search_keyword (case insensitive) and the genre matches selected_genre exactly. Use the same list comprehension style with book as the iterator variable.
No-Code
Need a hint?

Check both conditions with and inside the list comprehension.