[docs] insort-insert

Erden Oktay oktay_erden at wheatonma.edu
Wed Feb 9 22:02:26 CET 2011


> import bisect
>>> scores = [(100, 'perl'), (200, 'tcl'), (400, 'lua'), (500, 'python')]
>>> bisect.insort(scores, (300, 'ruby'))
>>> scores
[(100, 'perl'), (200, 'tcl'), (300, 'ruby'), (400, 'lua'), (500, 
'python')]

I thought instead of insort you meant insert.

erden


More information about the docs mailing list