Вы почти правы, просто добавьте это:
def hotel_cost(days):
return 140 * (days - 1)
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 0
def rental_car_cost(days):
cost = days * 40
if days >= 7:
cost -= 50
elif days >= 3:
cost -= 20
return cost
def trip_cost(city, days, spending_money):
return rental_car_cost(days) + hotel_cost(days - 1) + plane_ride_cost(city) + spending_money
city = raw_input("where are you going? ")
days = int(raw_input("how many days are you staying? "))
spending_money = int(raw_input("how much spending money are you bringing? "))
print trip_cost(city, days, spending_money)
В режиме отсутствует часть трафика. Пожалуйста, попробуйте добавить это "& amp; mode = fasttest; car; traffic: enabled". Тогда вы также получите, например, вы отправили другую форму, например, для 10:00.
Здесь у нас есть несколько расширенных примеров для визуализации изолиний:
https://tcs.ext.here.com/examples/v3/isoline_routing
Это может быть интересным для вас тоже.