My Python scripts went from 60 lines to 8 after I finally learned functions
I spent two weeks copy-pasting the same 15 lines into every file for my dice roller project, then a guy in a Discord server showed me how to wrap it in one function with a name, and now I'm mad at myself for not asking sooner, so how did you all figure out when to stop repeating code?