incorect answer
Go to solution
Solved by Neil,
You want python's "elif" statement, and additionally, you can't just say "money - 50". That's just not a statement that does anything You want "money -= 50"
def rental_car_cost(days): money = days * 40 if days >= 7: money -= 50 elif days >= 3: money -= 20 return money
>>> def rental_car_cost(days):... money = days * 40... if days >= 7:... money -= 50... elif days >= 3:... money -= 20... return money...>>> rental_car_cost(3)100>>> rental_car_cost(7)230
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now