Map creation
📖 Scenario: You are creating a simple program to store and look up the prices of fruits in a store.
🎯 Goal: Build a Go program that creates a map with fruit names as keys and their prices as values.
📋 What You'll Learn
Create a map called
fruitPrices with exact entriesAdd a variable called
newFruit with the value "Mango"Add a new entry to the map using
newFruit as the key and 120 as the valuePrint the entire
fruitPrices map💡 Why This Matters
🌍 Real World
Maps are used to store related data where you want to quickly find a value by a key, like looking up prices by product names.
💼 Career
Understanding maps is important for many programming jobs because they help organize and access data efficiently.
Progress0 / 4 steps