For each value from [list] in [variable]

Last modified by admin on 2023/09/28 08:47

Represents a for-each-loop. Will iterate through the specified list by saving each item in the specified variable. The loop iterates from the first item in the list to the last. E.g. if the list contains two items: {'Hello', 'World'}, in the first iteration the variable will contain 'Hello' and in the second 'World'.

Wait Brick

The End of Loop will be created automatically.

end-of-loop.png

Example

This example program lets you save numbers in a list by tapping the panda. After adding the items, the list will be iterated and each item will be checked whether it is dividable by 2, if so the counter will be increased.

for-each-value-1.png

Result

Download

for-each-value.gif