12/18 ask for error explain


#1

n = [3, 5, 7]
def print_list(x):
for i in range(0, len(x)):
print x[i]
print print_list(n)

error code: maximum recursion depth exceeded while calling a Python object,what is that mean :sweat:?


#2

Hi @javaace19518 ,

Because your code is not formatted, it is difficult for other users to read and debug it. After code is been pasted into the editing window for posting, you can format it by selecting it, and then by clicking the </> button above the editing area. This will enable us to see important details, such as the indentation and underscores.

Though we cannot see the indentation in your code, that is probably where the problem is. Did you indent this statement by mistake?

print print_list(n)

If so, that makes it part of the print_list function, which, as a consequence, would call itself recursively, then that call would lead to another, etc., until the maximum allowed recursion depth is reached.


#3

i got it~~the line five must to indent three times