Because in your double_list you call double_list again?
return double_list(x)
This will cause you to enter an infinite loop if you do not establish a condition in which it should break.
The OP has already solved it, and this is its solution:
n = [3, 5, 7] def double_list(x): for i in range(0, len(x)): x[i] = x[i] * 2 return x print double_list(n)
source share