Trip cost


#1

nights = raw_input("Enter nights: ")
city = raw_input("Enter city: ")
days = raw_input("Enter days:")
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 = 40*days - 50
elif (days >= 3):
cost = 40*days - 20
return cost
def trip_cost(city, days):
return nights + city + days

This is the code I have written. The error I am getting is
Oops, try again. trip_cost('Pittsburgh', 9) raised an error: coercing to Unicode: need string or buffer, int found.
I am not getting the mistake in my code. Can any one help me out


#2

@praneeth401,
Your trip_cost
should return the combined VALUE's
of hotel_cost(days)
and plane_ride_cost(city)
and rental_car_cost(days)


#3

Thank you very much Leonard. It worked!!