Pull it together


#1

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


#2

please post your code. :slight_smile:


#3

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


#4

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)

#5

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

if days >= 7:

#6

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