What should I do here? (4.Transportation)


#1

So, I'm stuck on number 4: Transportation. My code looks something like this:

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

I don't get what I'm doing wrong? It says "An error was raised for rental_car_cost(1): local variable 'total' referenced before assignment."


#2

I think you accidentally added an extra = sign here.


#4

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