Maybe I am missing something I want to use Math.Random to create a list of colors as long as another list.
OK< started this as different topic and dumped in wrong image. Although, this is useful question. I have a dynamo graph that adds the list indices to themselves but i can not access the index value of when the threshold is crossed.
I am new to python maybe I am coding this totally wrong. I want to be able to access the index of the value that trips the x value beyond 100. I want x to return to 0 and start counting again from that index until it hits 100 again.
OK, so I scrapped the python script and went back to the List.Scan to add each index to the next:
then in order to find where to cut the list I chose to use the nodes below:
Hope my simple question and solution I came up with helps those looking for a similar answer.
Also found out later that the Lunchbox 'Mass Addition" node does the addition, but still would need to know the index.
while(ad<lm && ct<List.Count(nm))
With Python …
while (ad<100) and (ct<len(IN)):
ad = ad + IN[ct]
Thank you very much for your time and effort! I will post my results, this seems like what I was attempting to do without the proper syntax. Still learning the languages.