Dictionary Creation
๐ Scenario: You are organizing a small library. You want to keep track of some books and their page counts.
๐ฏ Goal: Create a dictionary to store book titles as keys and their page counts as values. Then display the dictionary.
๐ What You'll Learn
Create a dictionary called
books with exact entriesAdd a new book entry count variable
Use dictionary comprehension to create a new dictionary with only books having more than 300 pages
Print the new filtered dictionary
๐ก Why This Matters
๐ Real World
Libraries, bookstores, and reading apps often use dictionaries to store book information and filter books based on user preferences.
๐ผ Career
Understanding dictionary creation and filtering is essential for data handling tasks in programming jobs like data analysis, web development, and software engineering.
Progress0 / 4 steps