Google Classroom
GeoGebraGeoGebra Classroom

Scripting: Select first false element from list

Description

You can get the index of the first element which value is "false" from the list L.

Script

a1 = true a2 = false a3 = true a4 = true a5 = true L = {a1, a2, a3, a4, a5} M = {1, 2, 3, 4, 5} L_1 =Unique(RemoveUndefined( Zip(If(Element(L, n) ≟ false, IndexOf(Element(L, n), L)), n, M)))

Demo