I've been stuck for a while on some online learning I've been trying.
I need to create a list of empty lists using recursion.
The strange thing is that I thought that I understood a factorial algorithm (which there is lots of help for) but not with this and as a result it always just returns the single [ ].
For example if n=4 then I would expect [[ ], [ ], [ ] ,[ ]]
def listOfLists(n):
lists = []
if i <= 1:
return lists
else:
lists += lists.append([])
listOfLists(n-1)