Displaying elements of a list, in columns I have a list of strings. I need to list them in rows and columns. Each row should not have more than "cols" number of values. Each of the values in a given row should be "step" away from the previous value. The values should appear only once in the output. Here is what I have. Any better way to write this code?

cols = 4
step = 10
vlist = ["Value" + str(i+1) for i in range(100)]

vlen = len(vlist)
start = 0
while start &lt; vlen and start &lt; step:
    num = 0
    for idx in range(start, vlen, step):
        if num &lt; cols:
            print(vlist[idx], end=", ")
            num += 1
    print("\n")
    start += 1
Fancy iteration in Python is often made easier using the itertools module.  For this case, itertools.islice() can help pick out the values for each row.

from itertools import islice

cols = 4
step = 10
vlist = ["Value" + str(i+1) for i in range(100)]

for row in range(step):
    print(', '.join(islice(vlist, row, cols * step, step)), end=", \n\n")