a = ['liu', 'yuan', 'is', 'a', 'chinese']
bisect_left(a, 'is')
此模块可以查找已知的element在序列中的index(从左向右找出第一个)
Python Doc
http://docs.python.org/release/2.5/lib/module-bisect.html
bisect_left(
| list, item[, lo[, hi]]) |
Locate the proper insertion point for
item in
list to maintain sorted order. The parameters
lo and
hi may be used to specify a subset of the list which should be considered; by default the entire list is used. If
item is already present in
list, the insertion point will be before (to the left of) any existing entries. The return value is suitable for use as the first parameter to
list.insert()
. This assumes that
list is already sorted.
New in version 2.1.