4/7 return trouble


Good day to you kind Sir’s :slight_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
return days * 40


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
        return 40 * days - 20


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


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.


thnx m8 thats really inspiring