Making lists of lists with code block

I am trying to create a lists of lists that has all meaningless data (e.g. could read 0 or a string of N/A) but of a certain size.

In the end, I will overwrite this data, but I need a blank list I can add data too for formatting purposes.

Is there a way to do this in a code block?

For example, I lets say I need (9) lists @ level 3, with (3) lists @ level 2, with (8) elements @ level 1.

Seems like there should be an easy way to do this? Every example I have found so far only writes to (2) levels and I need that 3rd level for what I am trying to do.

Any help is appreciated,

Thanks,
S&T

You could try:

Tho, you probably don’t need to. Lists in design script are “magical”. If you specify an index beyond the list’s current size, they’ll automatically grow to accommodate that index:

image

appreciated dimitar.

Still trying to understand dynamo, is what you have shown a python script within dynamo?
I need to read up on how to write code in python if that is the case, because what you have shown looks like a foreign language :smile:

I’m an engineer by education, and the only programming language I know is Matlab which, because it is my home, feels much more intuitive for organizing 3d data.

That’s the short-hand list syntax used in code blocks (double click on the canvas for a new code block) in Dynamo 1.3.x and earlier. Be sure to use square brackets in Dynamo 2.0 instead of the curly ones.

While you can easily replace the initial example with nodes:

there really isn’t a nodal equivalent for the second example…

oh also, you just peaked my interest, did not read the last part of your response,

Tho, you probably don’t need to. Lists in design script are “magical”. If you specify an index beyond the list’s current size, they’ll automatically grow to accommodate that index:

I am not noticing that in my “design script” where when I want to write to level 2 list 1 (i.e. skip the second list), it gives me an error.

see below.

if I change the circled value from a 1 to 0 @ list 5, the null list goes away.

Sounds like this is behaving differently from your understanding of how lists should work.