Taking a vacation / 4.Transportation

#1

``````Replace this line with your 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):
return 40 * days
if days >= 7:
cost -= 50
elif days >= 3 and days < 7:
cost -= 20
return cost``````

it says Oops, try again. It looks like rental_car_cost returns 120 instead of the correct amount (100) for 3 days.
i don't know what is wrong

#2

never mind figure it out

#3

OlĂˇ, tente o seguinte:
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
else:

def rental_car_cost(days):
total = 40 * days
if days >= 7:
elif days >= 3:
else:

#4

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):
total = 40 * days
if rental_car_cost >= 7:
elif rental_car_cost >= 3:
else:

my error message:

Oops, try again. It looks like rental_car_cost returns -10 instead of the correct amount (40) for 1 days.

what am i doing wrong??

#5

never mind. I've got it

#7

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