This module provides functions to insert items in sorted sequences.
insort(sequence, item) inserts item into the sequence, keeping it sorted. The sequence can be any mutable sequence object that implements __getitem__ andinsert.
Example: Using the bisect module to insert items in an ordered list
bisect(sequence, item) ⇒ index returns the index where the item should be inserted. The sequence is not modified.
Example: Using the bisect module to find insertion points
沒有留言:
張貼留言