Question: there's an example in Learn Python The Hard Way -- Python -- That I'm working on and I just couldn't quite think through it. I think I'm hiccuping on the theoretical elements of changing the program more than the writing the physical lines, but I could be completely wrong.

```
i = 0
numbers =[]
while i < 6:
    print "At the top i is %d" %i
    numbers.append(i)

    i += 1
    print "Numbers now: ", numbers
    print "At the bottom i is %d" %i

print "The numbers: "
for num in numbers:
    print num

```

This is the code that I'm working with and the question/ prompt reads as follows: 

> 
> Convert this while-loop to a function that you can call, and replace 6 in the test (i < 6) with a variable.
> 
> 
> 

If you can help and secondarily write out the significance of each line in layman's terms, that'd be of great help to me. 

Here is my first attempt:

```
def whilefunc(i):
    numbers = []
    for i in range(0,6):
        print "At the top i is %d" %i
        numbers.append(i)
        i += 1
        print "Numbers now: ", numbers
        print "At the bottom, i is %d" %i
    for num in numbers: 
        print num

```

Answer: 
I'm late to this question, but I too am taking this class and thought I could add to the discussion. I think the below code correctly answers 1-3 of the study drills for this lesson.

```
    numbers = []
    def numbers_list(x,y):
        i = 0
        while i < x:
            print "At the top of i is %d" % i
            numbers.append(i)
            i += y
            print "Numbers now: ", numbers
            print "At the bottom of i is %d" % i
        return numbers

    numbers_list(6,1)
    print "the numbers: "

    for num in numbers:
        print num

```

Output will be the same as above.
Think Zed Shaw just wanted us to convert the while loop (not the for loop) to a function... so I think it's just as simple as this.

```
def functiontocallforlist(x):
numList = []
i = 0
while i < x:
    print "At the top i is %d" % i
    numList.append(i)

    i += 1
    print "Numbers now: ", numList
    print "At the bottom i is %d" % i

#You can put whatever number you want as x really.
functiontocallforlist(8)

```