Last active
January 6, 2026 12:38
-
-
Save pythonhacker/34709152d1975dfde5fe6ee28c143fe0 to your computer and use it in GitHub Desktop.
Bisect insort functions demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> bisect.insort_left(l, 12) | |
| >>> l | |
| [10, 12, 15, 18, 20, 21, 21, 21, 24, 24] | |
| >>> bisect.insort_right(l, 20) | |
| >>> l | |
| [10, 12, 15, 18, 20, 20, 21, 21, 21, 24, 24] | |
| >>> bisect.insort_left(l, 17) | |
| >>> l | |
| [10, 12, 15, 17, 18, 20, 20, 21, 21, 21, 24, 24] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment