Transportation (what am i doing wrong)


#1
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):
    cost = 40 * days
    if days >= 7:
      cost -= 50
    elif days >= 3:
      cost -= 20

#2

your rental_car_cost function is part of your plane_ride_cost function, why? The rental_car_cost function should be outside/after plane_ride_cost function

the rental_car_cost function never returns the cost of renting a car, it should


#3

How do i separate the two functions from each other?


#4

indent, at this point in the course you should know that indent determines what is nested inside a function body, if clause and so on


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.