So if this is a list of strings then the strings should already be in

alphabetical order.

Or if this is a list of integers then they should be in ascending order.

And the second parameter x is an item and the function returns the offset where

the item x can be inserted into the list a while maintaining the order of the list.

So it's the leftmost position where x can be inserted in a such that

a is still in order after that insertion occurs.

So, bisect left is a useful function to us.

In this example we call bisect left with the parameter a,

which is this list up here.

And then the argument 2 and so bisect left is going to return the left

most index where we can insert 2 into this list such that the list is still in order.

And that's offset one, right here, so if we wanted to insert 2 into this list and

have this list still be in order we would put it right here between this 1 and

the first 3.

We would stick it right here and then we would shift all these entries over by one.

Here we're calling bisect_left with the parameters a and 4.

Bisect_left in this case returns the offset 3.

That means if we wanted to stick 4 in this list,

we would do it between here and here.

So we'd do it between the 3 and the 6.

And then in this final example we're calling bisect_left with a and

the parameter 8.

And it's telling us that if we want to insert a,

8 into this list, then the leftmost place we can insert it such that the list is

still in sorted order is at offset four.