(Transportation) incomplete


In the part that says Transportation, the instructions say

But how many days? Should I return the cost with a $ sign?


You may test your code with a variety of days to see how each discount is applied (or not).

No. Just print the numbers themselves.


Another question, do I print or return


Return from the function, and print the call expression.


I forget the name of the function, but you get what this means.


Here is my finished code:

def hotel_cost(nights):
    return 140*nights
def plane_ride_cost(city):
    if city=="Charlotte":
        return 183
    if city=="Tampa":
        return 220
    if city=="Pittsburgh":
        return 222
    if city=="Los Angeles":
        return 475
def rental_car_cost(days):
    if days == 7 or days > 7:
        return days_cost
    elif days == 3 or days > 3:
        return days_cost

Oops, try again. It looks like rental_car_cost returns None instead of the correct amount (40) for 1 days.


Indentation issue:

        return days_cost # remove one level of indentation


@mtf Actually, @printcoder_eric is missing this:

else:     # branch to allow for days < 3
     return days_cost * days

But, @printcoder_eric I am sure to have seen this same code with the same problem just 15 mins back in some other thread (edit: found it). Please always create a thread for your problem. And do not post the same problem in multiple threads. Thanks! :slightly_smiling:



Oops, sorry i will try to remember that also, it worked now.


We are forced to take five minutes out tracking down what may or may not be the lesson/exercise in question and often the correct category just to get a bearing on the question. As a result I work with what I see, not what is right. If members cannot see fit to provide a link to the ACTUAL exercise and post in the ACTUAL category, then I think I'm just going to quit answering questions. There is no more room for guess work, here.


I agree with you. This is definitely a problem for us.



I'm no Codecademy Moderator, but I can see how that might be painstaking. Just trying here but is a link like this https://www.codecademy.com/courses/python-beginner-en-pwmb1/1/1 what you mean?


Was sounding kind of whiny, there. Sorry about that.

Yes, the URL in the location bar of the lesson. It can be truncated...