In addition to alternative list implementations, the Library also offers other tools such asBisectModule with functions for manipulating sorted lists:
>>> 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')]
From: Python 2.6.1, Chapter II of brief tour of the standard library-part, tools for working with lists
Haha, obviously we can see the intention of Guido van rosum, expressed in scores, and then gave Perl 100 points, TCL 200 points, Ruby 300 points, and Lua 400 points, respectively, then it gave it the highest score of 500 for the Language Python :)
Others can understand ..... However, Ruby is behind Lua in its mind, which makes Ruby camp crazy -_-! Haha, although I have never learned Ruby, I have only learned Lua ......
Haha, just yy. This was accidentally obtained from the document :)