I would like to create an algorithm which takes in an integer n and returns an array whose entries give all n-tuples of nonnegative integers each of which is at most n, so like
A[n] = [0,0,0,...,0],
A[n] = [1,0,0,...,0], ...,
that kind of thing.
If n is small, I can manually create n-many for loops to do this, but in general I would like to allow n to be large. Is there an easy workaround? Any help would be appreciated.