19
I finally stopped writing my own sort functions for every project
For my first six months learning Python, I would write a new bubble sort or selection sort from scratch each time I needed to organize data. Last month, a friend pointed out the built-in sorted() function and list.sort() method, which are way faster and handle way more cases. Now I use those for almost everything, and it saves me so much time and code. What other basic built-in tools did you all miss when you were starting out?
2 comments
Log in to join the discussion
Log In2 Comments
oscarwilliams1d ago
Oh man, writing your own sort every time sounds rough. I did the same thing with manually checking lists for items before I found the "in" keyword. What was your biggest facepalm moment?
3
the_shane11h ago
Yikes, I once rewrote a whole JSON parser for a simple config file.
0