Plan your trip


#1

Oops, try again. It looks like nothing was printed to the console!
I keep getting this result. Nothing shows on my screen, why?

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):
rental = 40 * days
if days >= 7:
rental -=50
elif days >= 3:
rental -=20
return rental

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)

`


#2

Make sure the last line of code is on 0-space.

print trip_cost("Los Angeles", 5, 600)

This must not be inside of the function.


#3

Check to make sure this line is not indented.


#4

It was the identation! Thank you so much


#5

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