Data Structures Exercise Answer Key
Answer Key
fruits = ["apple", "apple", "banana", "grape", "orange", "orange"]
This is a LIST.
fruits = fruits.remove("grape")
manager = ("Robert", "Senior Software Engineering Manager", 42, "Columbus, OH")
This is a TUPLE.
manager.index(42)
national_brands = {"Nike", "Vans", "Converse", "New Balance"}
This is a SET.
global_brands = {"Nike", "Vans", "Fila", "Ecco"}
global_brands.intersection(local_brands)
inventory = {"Small T-Shirts": 45, "Medium T-Shirts": 72, "Large T-Shirts": 55, "XL T-Shirts": 60}
This is a DICTIONARY.
inventory = inventory.pop("Small T-Shirts")