Transportation


#1



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


What am i doing wrong? It keeps telling me:Oops, try again. An error was raised for rental_car_cost(1): global name 'cost' is not defined


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


#2

well these returns are not necessary. Get rid of them.


#3

im still getting the same error


#4

And to have an equal sign you only need one of these not 2 :thumbsup:


#5

fixed it thanks! :grin:


#6

No problem! :smiley: happy coding! :taco:


#7

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