The number of repeats might give you a hint of where this issue might arise. What sections of code do you have to repeat tasks? Consider what you’re you’re asking to be done in those sections and whether that actually matches what you want to happen. If you’re unsure a couple of print statements or a similar method of debugging might help you locate any problems.
It’s important to understand your own code in its entirety. Copy/pasting is always risky and it’s not great for learning either. Even if you find a solution to a problem you should then break it down a bit. What does each line do? When is that line executed? What would be the output? These are things you have to know and not things you can just guess at. Your main goal in these lessons is to understand the content. Just passing the lesson should not be your main goal, it risks being just a false sense of achievement.
I’ve left a hint about where to find your error and suggested a very basic method of debugging. I’d strongly encourage you to start working this way as you’ll be solving problems like this all the time. It’s a good skill to learn.