Retu


#1

Why is the following code throwing an error saying “Oops, try again. It looks like rental_car_cost returns None instead of the correct amount (40) for 1 days”.

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

I have my cost set to the number of days multiplied by cost… then an if statement to determine a discount.


#2

In your

where does the VARIABLE cars comes from ???

========================================================

In your IF ELIF construction…


 1 2 3 4 5 6 7 ...
 ? ? | >=3   | >=7
       and <7

where is the code for day =1= and day =2=


#3

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