Can anyone help me regarding my code and why is doesn't work?


#1



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


Error message: "Oops, try again. It looks like rental_car_cost returns 120 instead of the correct amount (100) for 3 days."


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

Before I had "elif 7 > days >= 3:" I had just "elif days >= 3:", the error was the same. Can anyone tell me what's wrong? Thank you!


#2

Move that line to underneath the elif return line with the same indent it now has.


#3

Thank you so much for your help!


#4

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