If I have a list like:
list = {23,21,18,15,13,12,10,9,8,7,7,5}
How can I remove numbers from that list so that no number less than 13 is on it without hardcoding, so if the list were different it would still remove any numbers less than 13?
I tried using the position like:
position = Position[list, 2]
listNew = list[[1;;position]]
It doesn't work because position's output is
{{10}}
DeleteCases
. This should evaluate to what you are looking for:DeleteCases[list,_?(# < 13 &)]
. $\endgroup$