Taking a Vacation - Transportation


#1

Here is the code i have, and i get this error: Oops, try again. An error was raised for rental_car_cost(1): maximum recursion depth exceeded
Please help :smiley:


#2

look at this code:

# function declaration
def example(x):
   print x

# function call
example("hello world")

see how i pass as argument on function call, which gets stored in the function parameter. in other words, days contains the number of days the car will be rented. Calling the function inside the function will cause a sort of infinity loop but then with functions, this is called recursion


#3

Thanks :slight_smile: that made alot of sence actually :slight_smile:


#4

good :slight_smile: can you figure it out from here or do you need more help?


#5

I did figure it out, turned out i had some more mistakes, but i figured that out too :slight_smile: So thanks alot :slight_smile:


#6

that is even better if you figure it out yourself :slight_smile: debugging is a separate skill :slight_smile:


#7

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