6/7 Hey, you nerver know (Incorrect values)


#1

if I Save the msg alway change to a new error of incorrect value.

Can any body help me to understand and not just give the code, please!?!

Thanks


#2

in your trip cost you forgot to add the hotel_costs(days)


#3

Worked.But why do I have to add hotel_costs(days) and not hotel_costs(nights)?

Thanks


#4

There is a bug in the code. The algoritm that checks the code is such that nights can not be included, and thus not defined in the def trip_costs (takes only two agruments, city and days). When you change night to days, it will work. In the first excersise the tutorial should ask for hotel_cost(days) instead of night.

One example of code that works:

def hotel_cost(days):
return 140 * days

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 :
return False

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

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


#5

cool ..Some times I get stoke but then I realize that is a bug.. there are few in here,..

Thanks