Nothing was printed to console


#1

def hotel_cost(nights):
    
    return 140 * nights
    
    print hotel_cost(6)
    
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 "Select a city from the list!"
        
def rental_car_cost(days):
    
    cost = 40 * days
    
    if days >= 7:
        
        return cost - 50
        
    elif days >= 3:
        
        return cost - 20
        
    else:
        
        return cost
        
def trip_cost(city, days, spending_money):
     return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city) + spending_money
     spending_money = 600
     
     print trip_cost("Los Angeles" , 5 , 600)

It says Nothing was printed to console

can someone tell me why ?

Edit - I have tried with removing the call to function hotel cost in the first part of the code still no luck


Plan your trip!
#2

Remove the indentation from this line. It looks to Python like it is still inside the function body.


#3

Ah! Fixed it. Thanks mate :slight_smile:


#4

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