Finally got my Python loop to stop crashing by printing the variable inside it
I kept getting an IndexError on line 14 of my shopping list script and could not figure out why. Turned out my range was going one past the end of the list, so I changed range(len(items)) to range(len(items) - 1) and it worked on the first try. I only found it because I started printing i and items[i] on each pass like a tutorial from Corey Schafer showed. What is your go to way to debug a loop that keeps blowing up?