Not sure what i am doing wrong


#1



 
My code:

def plane_ride_cost(city):
     return city
if city == "Charlotte":
    return 183
elif city == "Tampa":
    return 220
elif city == "Pittsburgh":
    return 222
elif city == "Los Angeles":
    return 475


#2

You can't put two simultaneously performed "return" statements in a program. You may try following code :

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 0


#3

That worked. thanks a lot!


#4

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