Getting a message saying nothing was printed


#1

I am also having troubles with this. Here is my code

def hotel_cost(nights):
return 140 * nights
def plane_ride_cost(city):
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):
if days >= 7:
return (40 * days)-50
elif days >=3:
return (40 * days)-20
else:
return 40 * days

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)

But i’m getting a message saying nothing was printed to the console. Any tips?


Python Taking a Vacation 7/7
#2

print trip_cost(“Los Angeles”,5,600) is possibly indented wrong. Can’t tell for sure without your code being formatted. But if that print line is indented the same as the return line above it that’s why. the print line should be indented the same as the def trip_cost line


#3

that was the issue. Thank you. It was that it was indented to the wrong place.


#4

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