Not Getting Proper Answer for Days=1 on Planning a Vacation


link to code:

Hey guys, my program is coming back with a result of 20 for days=1, but I'm not too sure how this is occurring. Here's my code for the transportation function.

Program is saying "It looks like rental_car_cost returns 20 instead of the correct amount (40) for 1 days". Let me know where the error is! Thanks.

def rental_car_cost(days):
    if days>=7:
        return days*40-50
    elif days<=3:
        return days*40-20
        return days*40


Did you mean to write,

elif days >= 3:



Sigh....I noticed just after I posted it, but thank you for finding it and replying! Cheers!


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