Transportation


#1

def hotel_cost(nights):
return 140*nights
def plane_ride_cost(city):
if city=="Charlotte":
return 183
if city=="Tampa":
return 220
if city=="Pittsburgh":
return 222
if city=="Los Angeles":
return 475
def rental_car_cost(days):
days_cost=40
if days == 7 or days > 7:
days_cost=days_cost*days
days_cost=days_cost-50
return days_cost
elif days == 3 or days > 3:
days_cost=days_cost*days
days_cost=days_cost-20
return days_cost
print(rental_car_cost(1))

what is wrong with this


#2

@nate_dogg_2003,

First re-edit your Post
so you display the indentation you are using.

Also what happens in your rental_car_cost() function
when the days are 1 or 2.....

Please re-edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

or even better use
= http://discuss.codecademy.com/t/using-backticks-to-format-your-code/3697
[extra's]
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet