Getting There


#1


At first I was stuck on Charlotte, then I managed to fix that but now Tampa is stating incorrect, but they're pretty darn similar. I've looked at other posts but none seem to be the same as mine :confused:

https://www.codecademy.com/courses/python-beginner-P5YtY/1/2?curriculum_id=4f89dab3d788890003000096#

Oops, try again. It looks like plane_ride_cost does not return 220 when the city is Tampa.


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


#2

Your function ignores its parameter, there's no way it'll be able to figure out the plane cost without considering what the destination is


#3

When I added:city == " that fixed it. I'm still trying to understand the functions I'm creating. It's a learning process, for sure.


#4

Note that your hotel_cost function calls itself each time it is called - that's an infinite loop


#5

Thanks! I've fixed that, even though it worked. For my own knowledge, that's going to cause problems, I assume?


#6

Infinite loops always cause problems.


#7

Well it's not going to finish.. There won't be a result


#8

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