Grasshopper

algorithmic modeling for Rhino

i am using python to create data which will be processed in a loop. 
the input is any integer 

coding:

// x is given as input =5

a=[][]
for i in range(0,x):
.....a[x][i]=i

expected output :

{(0),(0,1),(0,1,2),(0,1,2,3),(0,1,2,3,4),(0,1,2,3,4,5)}

i know there will be some blender mistake.. but please help me out.

Views: 228

Replies to This Discussion

Hi Solomon,

Try this:

a=[]
for i in range(x+1):
    a.append(range(i+1))

print a

Grasshopper does not support python's nested sequences. So in order to see your result in panel going out from the "a" output, you would have to use data trees.

Thank you so much.. it helps me.. :)

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service