Help on code please


#1

Hi I dont know what is going on i have everything set correctly so could yall help me out
here is what my code is:

def hotel_cost(nights):
return 140 * nights
def plane_ride_cost(city):
if plane_ride_cost == "Charlotte":
return 183
if plane_ride_cost == "Tampa":
return 220
if plane_ride_cost == "Pittsburgh":
return 222
if plane_ride_cost == "Los Angeles":
return 475


#2

Your plane_ride_cost will never equal a city name as your code expects it to:

if plane_ride_cost == "Charlotte":

Perhaps the name of a city will.


#3

Thanks for all the help it worked


#4

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