Plan Your Trip! Very confused on why this is not working!


#1
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
    else:
        return 475

def rental_car_cost(days):
    cost = 40 * days
    if days >= 7:
        cost -= 50
        return cost
    elif days >= 3:
        cost -= 20
        return cost
    else:
        return cost

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

Oops, try again. It looks like nothing was printed to the console!

Any help? :-/


#2

apparently it was just my print line being indented. anyone else here having this problem DONT indent your print command


#3

Dear Jesse,

I had the same problem. Thanks for your hint.

Luca


#4

I did it without the indentation and it still says that i have it wrong :slightly_smiling:

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 """Please choose from the listed cities:
-Charlotte
-Tampa
-Pittsburgh
-Los Angeles"""
def rental_car_cost(days):
cost = days * 40
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
print trip_cost("Los Angeles", 5, 600)


#5

Try writing your last line like this: it worked for me :slightly_smiling:
print trip_cost ("Los Angeles", 5, 600)

with the spaces :slightly_smiling:

let me know if it works for you!
`


#8

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 -= 50
elif days >= 3:
cost -= 20
return cost

def trip_cost(city,days,spending_money):
return hotel_cost(days) + rental_car_cost(days) + plane_ride_cost(city) + spending_money
print trip_cost("Tampa", 5, 855)

that worked for me