Plan your trip!


#1


https://www.codecademy.com/courses/python-beginner-P5YtY/1/6?curriculum_id=4f89dab3d788890003000096#

It keeps printing None
what's wrong here?


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=40*days
    if days>=7:
        cost -=50
    elif days>=3:
        cost -=20
        
    return cost
    
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", 5, 600)


#2

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", 5, 600)

remove the space before print.you should call the function right below the def trip_cost() .


#3


#4


#6


#7

Ok so my previous answer was based on the fact I thought you were on the same lesson. You are not therefore sorry for that misunderstanding. Here it would seem that half of my answer was correct. You need to rearrange your print statement as to match your def trip_cost. City Days then Spending Money while here you have Days City Spending Money.


#9

Hi waterproof1234

They only asked about hotel cost,

Try this:

def hotel_cost(nights):
return nights*140
print nights*140


#10

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