For the exercise :
Pull it together
When I run the code it gives the following error:
Oops, try again. trip_cost('Pittsburgh', 1) returned 363 instead of the correct value 402
If I run it again, it cycles through the locations like so:
Oops, try again. trip_cost('Charlotte', 8) returned 363 instead of the correct value 1573
Oops, try again. trip_cost('Los Angeles', 2) returned 363 instead of the correct value 835
Below 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): if days >= 7: return 40*days-50 elif days >= 3 and days <= 6: return 40*days-20 elif days <=2: return 40*days def trip_cost(city, days): days = 1 return rental_car_cost(days) + plane_ride_cost('Charlotte') + hotel_cost(days)
Can anyone see anything glaring?
EDIT: I've used 'Charlotte' and "Charlotte" and get the same error. When I say it cycles through error city names at the start, that is with still using Charlotte. If I change to say "Tampa", it still cycles through various city name errors. It's so strange.
Thanks so much...