Showerthought: my first real function actually worked on the third try
I was stuck for an hour trying to get a list of names to print in reverse order, and my code kept crashing. I finally looked up a guide from a site called freeCodeCamp and used a simple for loop with a negative step. Has anyone else found a good trick for working with lists backwards?
Yeah, that negative step loop is a lifesaver. I mean, I always forget the syntax and have to look it up again. Another thing that works for me is using reversed() if you just need to go through the list once. It's cleaner sometimes, idk. But honestly, printing stuff backwards used to make my brain hurt until I just started writing it down on paper first.
Honestly, it's just printing a list backwards. Is it really that big of a deal to need a lifesaver? I get that the syntax can be tricky at first, but after a few times it sticks. Writing it down on paper seems like overkill for something this small. It's a simple loop, not brain surgery.