could anyone give me a hint about why I get errors like: Oops, try again. trip_cost('Tampa', 0) returned 780.0 instead of the correct value 220
The code works whatever I enter but I always get an error about a city that has not been entered and an incorrect amount for it.
city = raw_input("What city are you visiting.")
nights = float(raw_input("How many nights will you be staying for?"))
days = float(raw_input("How many days will you be renting a car?"))
return 140 * nights
print "the price per night"
if city == "Charlotte": return 183 elif city == "Tampa": return 220 elif city == "Pittsburgh": return 222 elif city == "Los Angeles": return 475 else: print "Please, choose a city from our list."
cost = 40 * days
if days >= 7:
return cost - 50
elif days >=3:
return cost - 20
def trip_cost(city, days):
return rental_car_cost(days) + hotel_cost(nights) + plane_ride_cost(city)
print"Rental car costs:"
print "Overall cost: "
print rental_car_cost(days) + plane_ride_cost(city) + hotel_cost(nights)