import random def generate_packing_list(duration, preferences, transportation): essentials = [ "Water (1.5 gallons per person per day)", "Food and snacks", "Tent or other shelter", "Sleeping bag", "Pillow", "Warm clothing for nights", "Light, loose clothing for days", "Sturdy boots", "Hat with brim", "Sunglasses", "Sunscreen (high SPF)", "Lip balm with SPF", "Headlamp or flashlight (with extra batteries)", "First aid kit", "Prescription medications", "Toiletries", "Hand sanitizer", "Wet wipes", "Toilet paper", "Trash bags", "Reusable water bottle", "Cup or mug with lid", "Plate and utensils", "Can opener", "Dust mask or bandana", "Goggles", "Earplugs", "Bike (strongly recommended)", "Bike lock", "Bike lights", "Bike repair kit", ] art_supplies = [ "Sketchbook", "Pencils/pens", "Paints", "Brushes", "Portable easel", "Craft materials", ] music_items = [ "Portable instrument", "Portable speaker", "Extra batteries or power bank", ] comfort_items = [ "Camp chair", "Shade structure", "Spray bottle (for cooling off)", "Battery-powered fan", "Hammock", "Earplugs", "Eye mask", ] transportation_items = { "car": ["Vehicle pass", "Extra gas", "Basic tool kit", "Spare tire"], "plane": ["Clear plastic bags for liquids", "Minimal packing", "Collapsible items"], "rideshare": ["Contribution to gas/vehicle pass", "Compact packing"], } packing_list = essentials.copy() # Add items based on duration if duration >= 5: packing_list.append("Solar shower") packing_list.append("Clothesline and clothespins") # Add items based on preferences if "art" in preferences: packing_list.extend(random.sample(art_supplies, min(3, len(art_supplies)))) if "music" in preferences: packing_list.extend(random.sample(music_items, min(2, len(music_items)))) # Add comfort items packing_list.extend(random.sample(comfort_items, min(3, len(comfort_items)))) # Add transportation-specific items if transportation in transportation_items: packing_list.extend(transportation_items[transportation]) # Add Burning Man-specific items burning_man_specifics = [ "Gifts to share", "Costume pieces", "EL wire or other lighting for nighttime", "Portable ashtray", "Playa-friendly moisturizer", "Electrolyte packets", ] packing_list.extend(burning_man_specifics) return packing_list