Pull it together


plz i wonna understand something when i print rental_car_cost(10)it on ly makes days * 40 plz help how to do the discounts in the function


please post your code. :slight_smile:


Is this the question where we are asked to assign a discount based on duration?


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


If the SCT is looking for a code pattern, it will likely be,

if days >= 7:


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