Python IF statment with Boolean list input

When two (or more) inputs are directly connected you can iterate through each list simultaneously by zipping them together.

grid = IN[0]
bool = IN[1]

for g, b in zip(grid, bool):

You also don’t need to check a boolean with a test. You can simply use

if b: 
    this
else:
    that
3 Likes