Question: (5 pts) Write a function that calculates all your costs for the road trip. (5 pts) This function should take variadic keyword arguments and the

(5 pts) Write a function that calculates all your costs for the road trip.

(5 pts) This function should take variadic keyword arguments and the keys are the cities that you visited and the values are the number of nights that you spend in each city.

(5 pts) A user may enter a city and the number of nights that he/she will spend in those cities as much as he/she wants. If the city that the user entered is not in the file (cities.csv), do not add this city in the calculation and show a warning message.

(5 pts) Please calculate the overall cost of your trip and print it on the screen.

cities.csv file includes the cost of renting a car (per day) and hotel cost (per night) for 10 different cities. Please read the csv file and into a Pandas Data Frame. Then you can use the fields of this data frame when it is necessary.

p.s. the number of days will be counted as equal to the number of nights.

Hint. Create a dictionary whose keys consists of the cities and the values are the number of nights that a user spend. Send this dictionary as variadic keyword arguments.

Example Run:

Enter the name of the city and the number of nights that you spendBoston Portland

Enter the number of nights that you spend2 3

Total cost of your trip is 1040.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!