Difference between revisions of "KeepIf Command"

From GeoGebra Manual
Jump to: navigation, search
Line 3: Line 3:
 
; KeepIf[Condition, List]: Creates a new list that only contains those elements of the initial list that fulfil the condition.
 
; KeepIf[Condition, List]: Creates a new list that only contains those elements of the initial list that fulfil the condition.
 
: {{Example|1=<code>KeepIf[x<3, {1, 2, 3, 4, 1, 5, 6}]</code> returns the new list ''{1, 2, 1}''.}}
 
: {{Example|1=<code>KeepIf[x<3, {1, 2, 3, 4, 1, 5, 6}]</code> returns the new list ''{1, 2, 1}''.}}
{{note|For list of numbers arbitrary condition may be used. For list of other objects one can use only conditions of the form <code>x==constant</code> or <code>x!=constant</code>.}}
+
{{note|1=For list of numbers arbitrary condition may be used. For list of other objects one can use only conditions of the form <code>x==constant</code> or <code>x!=constant</code>.}}

Revision as of 21:44, 26 September 2011


KeepIf[Condition, List]
Creates a new list that only contains those elements of the initial list that fulfil the condition.
Example: KeepIf[x<3, {1, 2, 3, 4, 1, 5, 6}] returns the new list {1, 2, 1}.
Note: For list of numbers arbitrary condition may be used. For list of other objects one can use only conditions of the form x==constant or x!=constant.
© 2024 International GeoGebra Institute