If Statement gives weird result

Hello everyone,

I created an if statement but it gives a wrong result, see below:

Can someone explain to my why this happens?
Thanks in advance!

Its a limitation in Dynamo whenever you use the ternary operator; it cant handle lists and single objects, and replicates no matter what so the output is always a list and thats what you’re seeing. Use ScopeIf node instead.

Instead of scope if which can be problematic in a dyn, why not try some design script?

indx = test ? 0 : 1;
[truelst, falselst][indx];