4/7 need help



an error was raised for rental_car_cost(1): global name 'cost' not defined

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


Ok, let me ask you a question, what is the meaning and purpose of this line:

cost - days * 40



I do not known why I put it their. @factoradic but deleted it and it still did not work.


Well, I never said that you should delete this line.

The base cost of the rental is calculated by this formula:

cost = days * 40

You see? You have used - in place of the =.

Same thing happens in the few next lines.


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