Taking a Vacation pull it together


#1



https://www.codecademy.com/ja/courses/python-beginner-P5YtY/1/4?curriculum_id=4f89dab3d788890003000096#

Oops, try again. trip_cost('Los Angeles', 4) returned 1035 instead of the correct value 1175


that it gives correct value


`python

Replace this line with your code.

city = raw_input("Where will you be going?")
def hotel_cost(nights):
return 140 * nights

def plane_ride_cost(city):
if city == "Charlotte":
cost = 183
return cost
elif city == "Tampa":
cost = 220
return cost
elif city == "Pittsburgh":
cost = 222
return cost
elif city == "Los Angeles":
cost = 475
return cost

def rental_car_cost(days):
cost = days * 40
if days >= 7:
cost -=50
elif days >= 3:
cost -=20
return cost

def trip_cost(city, days):
return plane_ride_cost(city) + hotel_cost(days)


#2

I hope somebody can help me i think i did the code good but missing something i think but i really dont know what im doing wrong


#3

Looks like your missing part of your return! Make sure your returning all the information necessary for it! 02. Like the example above, have your function return the sum of calling the rental_car_cost(days), hotel_cost(days), and plane_ride_cost(city) functions.


#4

Aah i get thanks men. Dont know if it comes in next exercise but how can i print it like i say i go to charlotte 5 days and print that


#5

If I understand what your asking then yes its coming in the next two lessons. And no problem glad to have helped! :smiley:


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.