INSTRUCTIONS
Below your existing code, write a function called plane_ride_cost that takes a string, city, as input. The function should return a different price depending on the location. Below are the valid destinations and their corresponding round-trip prices.
"Charlotte": 183
"Tampa": 220
"Pittsburgh": 222
"Los Angeles": 475
Kóði: Velja allt
def plane_ride_cost(city):
if city == "Charlotte":
return 182
elif city == "Tampa":
return 220
elif city == "Pittsburgh":
return 222
elif city == "Los Angeles":
return 475
else:
print "Invalid input"
Fæ alltaf error:
Oops, try again! It looks like plane_ride_cost does not return 183 when the city is Charlotte.