Need help transportation taking a vacation


Did you create a function called rental_car_cost?

I expected it to work as I totally defined it

    def rental_car_cost(days):
        cost = days * 40
        if days >= 7:
            return cost - 50
        elif days >= 3:
            return cost - 20
            return cost


Hi @ayusshverma,

Is this function header indented? ...

    def rental_car_cost(days):

If so, Codecademy will not recognize rental_car_cost as a global function name.


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