#In Python, the most common way to work with key-value pairs is through a dictionary. 
# A dictionary allows you to store data in a way that each unique key maps to a
# specific value. You can access values by referencing their keys.

#Key Pair Values

# Creating a dictionary with key-value pairs
user_profile = {
    "name": "Nitheesh",
    "age": 30,
    "city": "Swansea"
}

# Accessing values by their keys
print(user_profile["name"])  
print(user_profile["age"])   
print(user_profile["city"])  

#--------------------------------------------------------------------------------------------
# Shopping cart with item IDs as keys
cart = {
    "item_101": {"name": "Book", "quantity": 2, "price": 15.99},
    "item_102": {"name": "Pen", "quantity": 5, "price": 1.99},
    "item_103": {"name": "Notebook", "quantity": 1, "price": 5.99}
}

# Accessing item details using keys
print(cart["item_101"]["name"])  # Output: Book
print(cart["item_101"]["price"]) # Output: 15.99
