Dictionary key-value collection
📖 Scenario: You are managing a small store's inventory. You want to keep track of product names and their quantities using a dictionary.
🎯 Goal: Create a dictionary to store product names as keys and their quantities as values. Then, update and display the inventory.
📋 What You'll Learn
Create a dictionary called
inventory with exact product-quantity pairsAdd a new product quantity variable called
newProductQuantityUse a
foreach loop with variables product and quantity to iterate over inventoryPrint the product names and their quantities exactly as specified
💡 Why This Matters
🌍 Real World
Stores and businesses use dictionaries to keep track of products and their quantities efficiently.
💼 Career
Understanding dictionaries is essential for managing data collections in software development and database management.
Progress0 / 4 steps