Hi I tried the most simplest for loop there is in python but I getting erro and how to fix it?
change
dataEnteringNode = IN
to
dataEnteringNode = IN[0]
?
yes thanks it is working now
dataEnteringNode = IN
declares all python inputs as IN
. If you look at your python node you have one input (IN[0]
). In order to call that specific input you would need to either get IN[0]
or set IN[0]
to a new variable.
I don’t think you want dataEnteringNode = IN[0]
. It would cause confusion if you had multiple inputs. The proper solution would be to use
a = a + IN[0][i]
or
sequence = IN[0]
[code...]
a = a + sequence[i]