A=[2,3,5,7,11,13]
print(A.index(5))
The answer is 2, But what I need is the first one which is bigger than 4 (the answer will be the same - 2). I can apply a while loop, but is there a more elegant or a builtin way to do it? In my problem the list is sorted in an ascending order (no duplication), and my target is to split it into two lists: lower or equal to 4, and bigger than 4; and given the list is sorted it would be redundant to scan it twice (or even once).