4/7 return trouble


#1

Good day to you kind Sir's :smile: i get a strange error while executing this piece of code could please show me my errors

days = float(raw_input("Enter amount of days:"))
def rental_car_cost(days):
if days >= 7:
return days * 40 - 50
elif days <= 3:
return days * 40 - 20
else:
return days * 40


#2

This should rightly be a counting number (integer). Neither here, nor there, though since the instructions do not ask us for user input. I would leave that line out, for the time being.

The code above is awarding a 20 dollar discount for 3 or less days. Less than 3 days should get no discount.

    if days < 3:
        return 40 * days
    elif days >=7:
        return 40 * days - 50
    else:
        return 40 * days - 20

#3

a big thanks coming your way, i still cant get the syntax correctly :smile:


#4

Syntax is something we more or less pick up along the way. Logic is something we have to work at improving every step of the way. Go with working on the second, and let the first take care of itself. You're on the right track so reward yourself.


#5

thnx m8 thats really inspiring