# Name # CSE 160 # Autumn 2025 # Coding Practice 6 # Problem 1 """ You want to cook a multi-course meal. You create a dictionary that keeps the ingredients you need for each recipe. Before you go to the store, you want to sort through the ingredients so you only have each ingredient once. Write a function, set_shopping_list() that returns the set of unique ingredients you will need for all meals. Return your result as a set. """ # Write your solution to Problem 1 here """ Example: meal = {"Salad": ["Tomato", "Mozzarella", "Olive oil"], "Pasta": ["Pasta", "Tomato", "Mozzarella", "Pesto", "Garlic"], "Garlic bread": ["Bread", "Garlic", "Olive oil"]} set_shopping_list(meal) --> {"Tomato", "Mozzarella", "Olive oil", "Pasta", "Pesto", "Garlic", "Bread"} """ # Problem 2 """ You graduate from UW and have 3 job offers lined up (you rock!). You are trying to decide where to move to. Each job is in a different city: Seattle, San Francisco, and Portland. You found a few open apartments in different neighborhoods within those cities and want to decide which job to take based on where to find the cheapest apartment. Write a function, find_cheapest() that will take in the apartments as a nested structure (dictionary of dictionaries) and return the city, neighborhood, and price of the cheapest apartment as a tuple """ # Write our solution to Problem 2 here """ Example apartments = {"Seattle": {"U Village": [1400, 1600, 1200], "Capital Hill": [900, 1000, 900], "Fremont": [1000, 1100, 950]}, "San Francisco": {"Mission": [1300, 1100, 1000], "Chinatown": [1000, 950, 1100], "Marine": [1500, 1300, 1200]}, "Portland": {"Pearl": [1000, 1300, 1100], "Downtown": [900, 850, 1100], "Southeast": [1100, 1250, 1300]}} find_cheapest(apartments) --> ("Portland", "Downtown", 850) """