5/7 Taking a Vacation


#1

Hello, I am very confused here can anyone show me what I am doing wrong?
Here is my code:
def hotel_cost(nights):
return 140 * nights
def plane_ride_cost(City):
if City == "Charlotte":
return 183
elif City == "Tampa":
return 220
elif City == "Pittsburgh":
return 222
elif City == "Los Angeles":
return 475
def rental_car_cost(days):
Cost = 40 * days
if days >= 7:
Cost -= 50
elif days >= 3:
Cost -= 20
return Cost
def trip_cost(city, days):
return rental_car_cost(days), hotel_cost(days), and plane_ride_cost(city)
return trip_cost
I keep getting a syntax error. Help Please, Thanks


#2

@romanbeya:

You're supposed to return the sum of those functions, not all of them at once :slightly_smiling:


#3

@g4be Thank you very much! Have a great day!


#4

@g4be But how exactly would I do that??


#5

No problem, Romanbeya! Glad to help!

And to do that just use the plus operator "+" between each function call.

Example:

return functA() + functB()

#6

@g4be Thank you! You have been a great help!!


#7

No problem, Romanbeya! Glad to help!