Is there a way to add an amount of lists, and append that to a list?

Basically, i have a list, where i want to store other lists, is there a way to do this? basically like this:

list = []
for i in range(3):
    list.append(i+1 number of lists)

then i want the output to be:

[[], [], []]

Any suggestions?

Edit: So, I just realized that what i meant could be confusing, basically, i want a pyramid of numbers, so what i want the output to be is is:

       [num]
   [num+1][num+1]
[num+2][num+2][num+2]

(ofc, this is the vizualisation of when it gets printed out, and made not bad looking, it should be [[[num]], [[num+1], [num+1]], [[num+2], [num+2], [num+2]]] etc.)



from Recent Questions - Stack Overflow https://ift.tt/3malnyX
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)