Why maps are used
📖 Scenario: Imagine you run a small library. You want to keep track of how many copies of each book you have. You need a way to quickly find the number of copies by the book's title.
🎯 Goal: You will create a map in Go to store book titles as keys and their copy counts as values. Then you will look up and print the number of copies for a specific book.
📋 What You'll Learn
Create a map with string keys and int values
Add at least three books with their copy counts
Create a variable to hold the title to look up
Use the map to find the copy count for that title
Print the result
💡 Why This Matters
🌍 Real World
Libraries, stores, and many apps use maps to quickly find information by a name or ID.
💼 Career
Understanding maps is important for programming jobs that handle data lookup, caching, and fast access.
Progress0 / 4 steps