Created nested lists with python

image

Hi all,

I am very novice at python and moderate with dynamo and C. I would like to create a nested for loop to create i number of lists of length j each. Each list element would have a random number assigned. The important part is to not have a repeated number within the same sublist. Appreciate any help you can offer, thanks.

Well for starters, you need to put this into a Python Script node! Currently you are scripting Python in the Design Script environment :slight_smile: See how it is set up here: Dynamo Dictionary Script (EDIT: just realized this link will not send you directly to the Python script node due to the space in the hyperlink, but you can find the node in the link that this brings you to)

You can use a Code block for your Python code if you wrap it in quotes to make it a string, and use it with the Python Script From String node

This thread here should also help:

2 Likes