Recursive functions and lists appending/extending
This is a very simple code in place of a bigger problem, but I'm hoping I can tackle it in chunks. I'll start with my first problem. def testrecurse(z,target): x=[] if z<target: z*=2 x.append(z) x.extend(testrecurse(z,target)) return x This is a test function to help my brain out with recursion. It takes a number, then shows all the multiplications of two until it hits the target number. so if I enter: testrecurse(1,1000) I receive: [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] which is great! Output looks good and clean. But here's my problem, I'm having a hard time appending or adding that very