.7 Plan Your Trip! Isn't printing to screen


#1



.7 Plan Your Trip!


It gives me the following error:
"Oops, try again. It looks like nothing was printed to the console!"


I have tried everything and I think have been looking to hard at the code. I am missing what I am doing wrong here or if there is a bug.


def hotel_cost(nights):
    return 140 * nights

def plane_ride_cost(city):
    if city == "Charlotte":
        return 183
    if city == "Tampa":
        return 220
    if city == "Pittsburgh":
        return 222
    if city == "Los Angeles":
        return 475
    
def rental_car_cost(days):
    cost = 40 * days
    if days >= 7:
        cost -= 50
        
    elif days >= 3:
        cost -= 20
        return cost
    else:
        return cost
    
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)


#2

Remove the indentation from that line.


#3

Thank you very much! I knew it was something small.


#4

i'm with a similiar problem. This is my code , but When i run it doesn't print nothing ,and appear ''None" :confused: can u help me

def hotel_cost(days):
    return 140 * days
    
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 "There's not available flights for this city"
        
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):
    return plane_ride_cost(city) + hotel_cost(days) + rental_car_cost(days)
    
    print trip_cost("Tampa",11)

#5

This line has indentation that makes it look like part of the function above it. Remove the indentation.


#6

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