Transportation i need some help


#1

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

its says this
It looks like rental_car_cost returns 140 instead of the correct amount (100) for 3 days


#2

this is my code

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

put when i push save and sumit it says this
Oops, try again. It looks like rental_car_cost returns 140 instead of the correct amount (100) for 3 days.


#3

HI these lines

car += 50
car += 20

instead of + you should put -


#4

it fixed that but it still says this

Your code threw the following error: invalid syntax (python, line 15)


#5

CAn you post your new code?


#6

ef rental_car_cost(days):
car = 40 * days
car -= 50
elif days >= 3:
car -= 20
return car


#7

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


#8

the 2 one is the right one


#9

your code is right you just need to indent it like that

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

#10

it worked thanks again you are vary help full