Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't know here whether you would prefer a list or a matrix or an array as your final data type. But, here is one solution that first builds a list, in case you'd rather have a list. I'm sure there are many other more efficient solutions depending on what you want in the larger picture of what you are doing.

a=0
b=[]
for i in [1..10]:
    a+=1
    b.append(a)
matrix(b)