Plan your Trip! Need help


#1



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


Traceback (most recent call last):
File "python", line 24, in
File "python", line 23, in trip_cost
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'


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

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


But if I would indent print Trip_cost(,,,,)
then nothing would get printed.


#2

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

Log???


#3

What do you mean Log?


#4

Can you tell me difference between these two?

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

and

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


#5

Oh my God. Thanks)
Though I think I solved some error. Im not sure when I misspelled it, but it was correct, but not working at some point.


#6

Im having the same problem too what solution is it


#7

print trip_cost("Los Angeles", 5, 600)
nothing prints out


#8

Check your indention.


#9

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