8.taking avacation


#1

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
error =Oops, try again. Did you create a function called plane_ride_cost?
i want to know what is wrong with the code, some body help


#2

Please format your code correctly!

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

Above is correctly formatted...

You are missing the input for the city. Currently you if statements that don't have anything to work off. Try putting in the following line before your function...

city = input("City: ")

You should also make sure everything is capitalized correctly. Sometimes exercises are picky about that sort of thing.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.