Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use python, no outside imports, no recursion. Use a SINGLE FUNCTION to solve (no main methods or anything outside function call). Skeleton file: def trip_planner(tuplist):

Use python, no outside imports, no recursion. Use a SINGLE FUNCTION to solve (no main methods or anything outside function call). Skeleton file:
def trip_planner(tuplist):
ANSWER HERE
image text in transcribed
image text in transcribed
Eunction name trip_planner Parameters: list of tuples Returns, dictionary with each value as a dictionary Description: You and your friends are planning a trip to NYC! In preparation, you guys make a list together of things you want to do when you get to NYC, except it's a little bit disorganized with a lot of duplicate activities. Your job is to organize the list into a more accessible dictionary Each element in the input list is a tuple containing the category (string), name (string). and cost (int) of the activity. The output dictionary should arrange the activities first by using their category as keys. The assigned value of each category should be another dictionary that maps each corresponding activity name to its associated cost. If there are duplicate activities with the same category and name, their costs should all be added together >>list1 [Cshow, Shawn Mendes: the Concert, 100), (food, 'Levain Bakery, 10000) sightseeing. 'Statue of Liberty, 0), (show, "Hamilton', 20) (sightseeing', Brooklyn Bridge', 10), show, 'Hamilton', 70), Ctood, 'Halal Guys', 5), (show, Shawn Mendes: the Concert, 200)] >> print(trip_ planner(list1)) show: [Shawn Mendes the Concert: 300, Hamilton': 90), food: fLevain Bakery' 10000, Halal Guys': 5), 'sightseeing: [Statue of Liberty': 0, 'Brooklyn Bridge: 10))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data 29th British National Conference On Databases Bncod 2013 Oxford Uk July 2013 Proceedings Lncs 7968

Authors: Dan Olteanu ,Georg Gottlob ,Christian Schallhart

2013th Edition

3642394663, 978-3642394669

Students also viewed these Databases questions

Question

List out some inventory management techniques.

Answered: 1 week ago