Python taking a vacation ( Pull it together) HELP


I'm having issues with the "maximum recursion depth exceeded in cmp" i have attatched an image so everyone has a clear idea on what i'm talking about.

Edit: i also ran this code in and it runs fine in there.

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
    return plane_ride_cost(city)
def rental_car_cost(days):
    car_rental = 40 * days
    ##car == 40* days ($40 a day)
    if days >=7:
        car_rental -=50
    elif days >= 3:
        car_rental -=20
    return car_rental

def trip_cost(city, days):
    return rental_car_cost(days) + hotel_cost(nights) + plane_ride_cost(city)


Could you post your code instead of a screenshot, so we are able to test it.


Okay, I have posted the code as requested.


You are calling hotel_cost with wrong parameter. Have a little look at it.


If you're implying that i've labeled it "nights" instead of days it doesn't matter both, have the same re-curve error.


Haha now I got it. Your problem is not in this part of the code. Look at your function called plane_ride_cost ;
Names of the cities must begin with a capital letter.


Oh shoot, your right, to be honest this should have been picked up ages ago so this error does'nt occur.
Thank-you so much for the help @papusalaatti !


No problem, Adam. :slight_smile: I just don't understand how you passed the earlier exersice if your letters were not capital.


I really don't know but I am going to submit a ticket to the developers so they can edit this semi "bug" :slight_smile:
Once again thank you so much for your help.


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