Hi I am trying to practice on recursion question and have been facing an issue
def recurr(container = [], index = 0):
print(str(container) + " " + str(index))
if index == 10:
return recurr
recurr(container.append(index), index+1)
print(recurr())
This function takes container as list and index as int, now I am trying to append index in container and increment index. But whenever the function is called the value of the container becomes 'None' and I get an error "AttributeError: 'NoneType' object has no attribute 'append'". I am not sure what am I doing wrong so if someone can help me understand that I would be really grateful.
Thank you