Why isnt my code working?


#1

def hotel_cost(nights):
return 140 * nights
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 "i dont know"


#2

whats is your error message ?


#3

In def plane_ride_cost(city) you are returning ints as strings. Any place you are returning numbers, remove the quotes from around the number.


#4

You have quotes around your numbers in your plane ride function which makes them strings, remove the quotes from the numbers in your return statements and you should be good. :slight_smile:


#5

Yeah...Thanks...That worked out!:slight_smile:


#6

Thank You...that worked!:slight_smile:


#7

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