Need help transportation taking a vacation


#1


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


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
        else:
            return cost


#2

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.


#3

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