7/7 Taking a Vacation unsupported operand type(s)

I can’t figure out what’s wrong. It says:

Traceback (most recent call last):
File “python”, line 22, in
File “python”, line 20, in trip_cost
TypeError: unsupported operand type(s) for +: ‘int’ and ‘NoneType’

def hotel_cost(nights):
return 140nights
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):
if days>=7:
elif days>=3:
return total
def trip_cost(city, days, spending_money):
return hotel_cost(days)+rental_car_cost(days)+plane_ride_cost(city)+spending_money

print trip_cost(“Lost Angeles”, 5, 600)

Btw was scrolling through other Q&A’s and yes my final print is NOT indented and I believe my entire code is indented properly but please correct me if indentation is actually the problem.

######Have a close look at
#Lost Angeles

Thank you so much! That was my problem also. LOL

does anyone know what is wrong with this block of code?

def trip_cost(city,days, spending_money):
return plane_ride_cost(city) + rental_car_cost(days) +hotel_cost(days) + spending_money
print trip_cost(“Los Angeles”, 5 , 600)

it keeps returning no value

Have you tried a reset of your Browser

++++ reset of session *****************
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser


Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom

Great…cache issue…ThankU

def plane_ride_cost(city):
#city = raw_input(prompt)
if city == “Charlotte”:
return 183
elif city == “Tampa”:
return 220
elif city == “Pittsburgh”:
return 222
city == “Los Angeles”
return 475

def rental_car_cost(days):
car_cost = 40 * days
if days>=7:
car_cost -= 50
elif days>=3:
car_cost -= 20
return car_cost

def hotel_cost(days):
return days * 140

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)

You have to call the function after the return. We also have learned that space matters. Make a new line between the function and than call the function.


print trip_cost(“Los Angeles”, 5 , 600)