Taking a vacation / script.py


#1

Hi all
This is my code and I receive error, I can't find my mistake

the error is: File "python", line 19
def trip_cost(city, days):
^
IndentationError: unindent does not match any outer indentation level


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 = days * 40
    if days >= 7:
        cost = cost - 50
    elif days >= 3 and days < 7:
        cost = cost - 20
    return cost
 def trip_cost(city, days):
     return hotel_cost(days)+ plane_ride_cost(city)+ rental_car_cost(days)
  def hotel_cost(days):
    return 140 * days


#2

 def trip_cost(city, days): #remove spaces before def

   def hotel_cost(days): #same here

#3

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