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: 
```
def while_loop(number, increment):

    i = 0
    numbers = []

    while i < number:
        print "At the top i is %d" % i
        numbers.append(i)   

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

    print "The numbers: "

    for num in numbers:
        print num

while_loop(int(raw_input("Enter a number: ")), int(raw_input("Enter increment: ")))

```
I have a solution that I think might be easier! I am just getting started and I think my ignorance has aided in keeping it simple. Also, I am working from Zed A Shaw’s Python 3 book.

Here’s what I came up with:

```
def loop(material):  #here is where I define the function (loop) with a variable (material)

    i = 0      #the rest of the exercise can remain pretty much intact
    numbers = []

    while i < material:    #I have replaced the number 6 with my variable
        print(f”At the top i is {i}”)
        numbers.append(i)

        i = i + 1
        print(“Numbers now: “, numbers)
        print(f”At the bottom i is {i}”)

    print(“The numbers: “)

    for num in numbers:
        print(num)

loop(10)   #here I call the function and define the variable as 10

```

Hopefully this makes sense!