Taking a Vacation lesson


#1

I know the answer but can someone explain to me why this dosnt work?

def rental_car_cost(days):
    total = 40 * days
    if days >= 7:
        total = total - 50
        print  total - 50
    elif days >= 3 and days < 7:
        total = total - 20
        print total -20
    else:
        print total
rental_car_cost(raw_input('How many days do you need a car?'))

#2

because raw_input doesn't make your input a number, so you need to cast it to a number:

rental_car_cost(int(raw_input('How many days do you need a car?')))

#3

Thank you, much appreciated


#4

Im pretty it wanted you to use cost so i would change total to cost, and remove

"and days < 7"

and the raw input line, then you should be fine