Problem with if condition output

Hey, I am trying to rund a script that will set amount of steps based on an “if” condition in which if true, it should give an output of a list comprised of 4 items, if “false” it should give an output of a list comprised of 3 items (you can see in script).
It seems that when the condition results as “true” and should put list of four items - it only prints the first 3 items, as though the list of 3 items limits the index amount.
I’m am trying to bypass issue but not quite there yet.

Anyone have any ideas?

1 Like

Hi @zvith !
Here is a way to solve it :

2 Likes

When I have a list with a different number of items I create a very simple Python script. Something like:

result=[]

if IN[0]==True:
   result.append(IN[1])
else:
   result.append(IN[2])

OUT=result
3 Likes

You could also create a very simple If statement through code block:

If == true ? In1 : In2 ;

2 Likes

It’s so simple it makes me wonder how I didn’t think about it!
:sweat_smile:

Creating python scripts is the next thing I will learn how to do!

Python does not make a difference regarding the number of elements. In this case, you do not need a huge knowledge of python it is very simple.