I spent 3 months putting my print statements inside the loop instead of after it
Sat there at 1am debugging a score tracker for my daughter's math game when it hit me that the total kept resetting because I was printing inside the for loop instead of after it, and I only caught it when I drew the loop out on paper like my old CS teacher kept telling us to.
Honestly the print statement spot isn't where your bug was though. Printing inside the loop just means you print a bunch of times, it doesn't make your total reset. What actually resets a total is re-declaring it inside the loop, like putting total = 0 up top where the for line is. So printing inside probably just made the reset show up over and over so you could see it, but the real fix was moving that total line out. Tbh I've made this exact mistake with counters and it took me way too long to get it. Drawing it out on paper is legit the move though, my old teacher said the same thing. Next time check where your variables get set, not just where you log them.