return 140 * nights
if city == 'Charlotte': return 183 elif city == 'Tampa': return 220 elif city == 'Pittsburgh': return 222 elif city == 'Los Angeles': return 475 else: return 0
amount = 40 * days
if days >= 7:
amount -= 50
elif days >= 3:
amount -= 20
def trip_cost(city, days):
return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days)
What does it mean with amount -= 50? If days >= 7, subtract or... equals 50 dollars? Couldn't I just put a -?
Also, why does the call (days) work with hotel_cost if (nights) was used in the original function? I didn't get the example in the instruction window.