7/7 not printing anything


#1
what am i doing wrong?:frowning:

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):
carcost = 40 * days
if days >= 7:
carcost -= 50
return carcost

 elif days >= 3:
    carcost -= 20 

 return carcost

def trip_cost (city,days, spending_money):

return   hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days) + spending_money

print trip_cost("Los Angeles",600)

#2

The trip_cost function takes in three arguments like so

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

you only provide 2


#3

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):
rent = 40 * days
if days >= 7:
rent =rent- 50
elif days >= 3 and days <7 :
rent=rent- 20
return rent
def spending_money(none):
return none
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)

#4

can u tell me the error ,it says nothing was printed to console !!


#5

I don't know if you still are having trouble, but the error is that you indented the "print" under the trip_cost function. I had the same problem


#6

Thank you! Thank you! Thank you so much!!


#7

For exercise 7, this is my code but I keep getting the error message that nothing was printed to the console. Please help!!

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