I wonder If, in Python, is there any way to get the index of an element that is not in the list, i.e the index in which this element should be.
I explain better:
Supposing that I have the following sorted list A:
A = [2, 4, 7, 11, 26, 41]
and I want to know which should be the index of the element 9 which is not in the list, I would like to get something like this:
index: 3
since in the sorted list A the element 9 would be the element at postion 3.
Is there any way to do so? Maybe by implementing a function?