Pulling it together


I am so stuck, and have tried a number of different arrangements and codes, can somebody help please?

My error at this point is:
Oops, try again. trip_cost('Pittsburgh', 3, 0) raised an error: unsupported operand type(s) for +: 'int' and 'NoneType'

def hotel_cost(days):
    return 140*days

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
        return "Unknown"

def rental_car_cost(days):

    if days>=7:
        return 40*days-50
    elif days>=3:
        return 40*days-20
        return 40*days

def spending_money(days):
    money = 50*days
def trip_cost(city, days, money):
    trip_cost = plane_ride_cost(city) + (days) + rental_car_cost(days) +spending_money (money)


This does not match up with the instructions. Are you making stuff up to experiment?


The extra bit with spending _money def is a last ditch attempt at trying to get it to work, and it was the most complete version of code I have.
Previous to putting that in I was getting errors from the towns not working, days not being defined, errors because it couldn't concatenate an int and string....
I've worked pretty much each suggestion in the discussion but haven't been able to find the correct method, obviously I'm missing something really basic in my code/method but I can't find it.
The term experiment implies some degree of skill or ability .... so no, I'm not experimenting! I only thought it was getting errors due to that not being specifically defined....


Yep, overthinking it again!


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