Please help, 7.Plan Your Trip!


#1

I am trying to print the final result.
But they say that " Nothing was printed to the console".
I dont understand that because i think that im doing fine..
Please help me guys!!

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) :
    
    
    if days >= 7 :
      return (days * 40) - 50

    elif days >= 3 :
        return (days * 40) - 20
    else :
        return days * 40
        
def trip_cost(city, days, spending_money) :
    return rental_car_cost(days) + plane_ride_cost(city) +  hotel_cost(days) + spending_money
    print trip_cost("Los Angeles", 5, 600)


#2

I already discover the error, city is first than days and than spending money!


#3

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) :
    
    
    if days >= 7 :
      return (days * 40) - 50

    elif days >= 3 :
        return (days * 40) - 20
    else :
        return days * 40
   

def trip_cost(city, days, spending_money) :
    return plane_ride_cost(city) + rental_car_cost(days) +  hotel_cost(days) + spending_money
print trip_cost("Los Angeles", 5, 600)

Here is the final code! I hope that i have help people.


#4

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