RichM499
Daemon Poster
- Messages
- 783
- Location
- Spaceballs Mega-Maid
Code:
def hotel_cost(nights):
c = nights * 140
return c
def plane_ride_cost(f):
if f == "Charlotte":
return 183
elif f == "Tampa":
return 220
elif f == "Pittsburgh":
return 222
else:
return 475
def rental_car_cost(days):
cost=days*40
if days == 0:
days = 40
elif days >= 7:
return cost - 50
elif days >= 3:
return cost - 20
else:
return cost
def trip_cost(city,days, spending_money):
return trip_cost
total = rentalcarcost(days)+planeridecost(city)+hotelcost(days)
return total + spending_money
print trip_cost("Los Angeles", 5,000)
This is the code. I'm having trouble figuring out why it's not working. it gives me
"<function trip_cost at 0x7f4b440ae578>
None " as output and allows me to pass this 'section' of the website I'm using to try and learn it but I can't figure out what is wrong with my code. Could anyone here help please?
Attachments
Last edited by a moderator: