Please help me out here, what is wrong with this code. I want the whole thing to come up on the console with prompts and all


#1
original = raw_input('Enter your destination:')
raw_input = city
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
  else:
    return "Destination not listed!"

#2

why would you do this:

raw_input = city

this will overwrite raw_input, preventing you from prompting for more input

original = raw_input('Enter your destination:') certainly good, now you need to call the function with original as argument to actual get the function to run. And a print statement in front of the function call to print the returned result

be aware that doing more then the exercise requires can sometimes cause trouble


#3

Please can you show me how? I am trying to do that and it is not working. I suppose I am not doing it right


#4

does it work here:

https://repl.it/@stetim94/CheerfulExtrasmallBluefish

If so, you do it right and the exercise is bugged. You might need to click the output window before you can type there


#5

Thanks. The code works just at displaying the input on the console back same as on the codecademy console
Here was my little modification:

original = raw_input(‘Enter your destination:’)
print original
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
else:
return “Destination not listed!”

however I wanted it to give me the response of cost for the cities or else “destination not listed”


#6

i covered this:

functions only execute when called


#7

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