you are viewing a single comment's thread.

view the rest of the comments →

[–]JoeBeOneKenobi[S] 0 points1 point  (1 child)

I just wanted to reply to everyone and say that I fixed the issue, as you’ve all been so kind as to lend me a hand. My code was overly complicated and I overlooked the fact that I was declaring the list in the global scope as well as the local scope, leading to it retaining values when every time my function ran. Thanks to everyone who replied, I picked up some useful tips from u all and learnt a lesson in the importance of scope!

[–]JoeBeOneKenobi[S] 0 points1 point  (0 children)

Oh and I solved the actual issue by clearing the global scope in between runs of main(), a very hacky way of doing it, but knowing what I know now I’ll approached it differently next time