Hi!
I am trying to get difference between two values of a list. (x[0] - x[1])
But when the size of a list is 1, index error occured.
so I want to set default value when the size of a list is 1.
I used == node and check whether the count and ‘1’ are equal to each other or not.
if the count equals 1, set value 3500.
if not equals, set value (x[0] - x[1]). <–I don’t know what to do.
Does your if node not return the desired option? In this case 3500? The error is inconsequential in that case as it will not be there if that is the option that is passed
The code block just uses Design Script syntax (and a little shorthand) to make the function more compact, but you can write the exact same thing using Count and GetItemAtIndex nodes with an If node.