Why won't my code work?


#1

Why won't my code work?
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"


I cannot find out whats happening here!
#2

Because you have written numbers as strings. "183" should be, 183. Same applies to the others.


#3

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