Question about my first Python script from a month ago
I looked at a simple program I wrote to sort a list of names, and compared it to one I just made that does the same thing. The new one is half as long and way easier to read, just from learning about list comprehensions. Has anyone else had a moment where a single new concept made your old code look totally different?
My friend Sam had a whole folder of scripts that used basic for loops to filter data. After he learned about list comprehensions from a post by @nelson.michael, he rewrote a 15-line mess into one clean line. He said it felt like finally being told the shortcut home after walking the long way for years. His old code looks like a different person wrote it. That one trick just changes how you see the problem.