Return on the car_rental_cost


taking a vacation, transportation

There is something wrong with the car_rental_block

 def hotel_cost(nights):

    return 140 * nights

def plane_ride_cost(city):
    if city == "Charlotte":
        return 183
    elif city == "Tampa":
        return 220
    elif city == "Pittsburgh":
        return 222
    elif city == "Los Angeles":
        return 475
        return 0

def rental_car_cost(days):

    return total == 40 * days

    if days >= 7:
        total - 50
        return total
    elif days >= 3:
        total - 20 
        return total
        return 0



Hello, @cloudjumper27938,

You shoudn't return total == 40 * days. You can either set total to 40 * days and return it on a separate line, or just directly return the value itself. Also, your code isn't working because you are directly returning the value, before the function can even move on to your if statement.

My suggestion?

Return total on the else statement of your if statement.


You could do that i went about it with another approac. You shouldn't return the total on your if or your elif
only at the bottom atleast that fixed my problem.


I won't put the correct code into this for the sake of you doing on your own but you also need something in the totals with the - sign do you know what that is?


Thanks everyone I got it.