bisect — Maintain Lists in Sorted Order — PyMOTW 3

The bisect module implements an algorithm for inserting elements into a list while maintaining the list in sorted order.

Read more…

This post is part of the Python Module of the Week series for Python 3. See for more articles from the series.