Why some code doesn't work? 6/8


#1
    def trip_cost(city,days,spending_money):
    return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days) + spending_money

def trip_cost(days,city,spending_money):
    return hotel_cost(days) + rental_car_cost(days) + plane_ride_cost(city) + spending_money

these are so similar, yet, only the upper code worked for me, why?


#2

for the code that works check out the method signature (i.e. the order of the method arguments)

def trip_cost(city,days,spending_money):

against yours

def trip_cost(days,city,spending_money):

it doesn't work because the first argument of the method is expected to be a string abut you are passing and processing an int in the implementation