Bug with Taking a vacation: Transportation


#1



Transportation:


Submitting the function with the correct name (rental_car_cost) prompts an error box saying "Oops, try again. Did you create a function called rental_car_cost?"


I at least expect it to recognize that the function is named correctly.


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


#2

weird, it should give the following:

Oops, try again. It looks like rental_car_cost returns None instead of the correct amount (40) for 1 days.

your function doesn't return the cost of renting a car for 1 or 2 days


#3

whoops,
I forgot to copy that part in, but its there;
here is the code in full

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

#4

that works fine? It passes the lesson and you should be able to progress. Is this the full cod you have?


#5

yes that is the full code, though i'm still getting the same error


#6

refresh the page, try a different browser. Seems you hit a glitch


#7

Yep, everything tried, and its still not letting me through


#8

i passed fine with your code, can i see screenshot?


#9

here it is


#10

your rental_car_cost is nested inside your plane_ride_cost function, the rental car cost function should be after/outside the plane ride cost function (hint: indention)


#11

Thanks! I wouldn't have spotted that in a hurry


#12