If I have a list of 100 integers, say {1,2...100}
, and I wished to delete all elements that are greater than a random integer $n$, what command should I use for this?
For example if $n=5$, how do I operate the original list to get the final list of {1,2,3,4,5}
?
BoolEval
package, available here. One of the functions in the package are available in the function repository, and it could be used withPick
. However, in the package itself there is a function calledBoolPick
which does exactly what you want with a very nice syntax. $\endgroup$ – C. E. Jan 15 at 12:27Select
for this. For example,Select[Range[100], LessEqualThan[5]]
$\endgroup$ – LouisB Jan 16 at 21:50