This is my code:
def trip(nights):
return 140 * nights
def plane_cost(ride):
if ride == "London":
return 220
elif ride == "Rome":
return 200
elif ride == "Glascow":
return 185
def car_rental(days):
cost = 20 * days
if days >= 7:
cost = cost - 25
if days >= 3:
cost = cost - 10
return cost
def tripcost(ride, days, spending_pounds):
trip(days) + plane_cost(ride) + car_rental(days) + spending_pounds
print tripcost("London", 5, 500)
Was wondering why the word tripcost
(marked in bold) was shown to be a syntax error when I loaded it in idlE?