Replace list items by 2 conditions

Hello, dear friends.
I have a list 1, 2, 3, …, 9, 10. I want to replace every item bigger than 3 and less and equal than 6.
How to combine these conditions to set them into the “ReplaceByCondition” node?

Nodes are in the picture.
What am I doing wrong?

This should be like in the picture (seems to be correct?), but the “condition” point in “ReplaceByCondition” requires a function…

The explanation (from @solamour)

e58d8229f934b5d3bd13da628dc2b177a681e9a8_2_690x325

2 Likes

OK, we get this true-false list… I need to replace items in the original list:

before
1, 2, 3, 4, 5, 6, 7, 8, 9, 10

after (>3, <= 6)
1, 2, 3, 100, 100, 100, 8, 9, 10

Even though the node “ReplaceByCondition” shows a “condition”, it needs a function.

1 Like

Why get complicated with it when a simple if statement will do the trick?

n > 3 && n<= 6 ? 100 : n;

7 Likes

Lol, you are absolutly right!

1 Like