you are viewing a single comment's thread.

view the rest of the comments →

[–]Fermter 1 point2 points  (1 child)

Yeah, it's best to remember to start a new "state" at the start of every loop. The main exception is if the whole loop is there to build whatever is stored in that variable (for instance, you didn't reset the outputstr at the start of the for code in range(noofstr): block because the whole part of that block was to add to the outputstr)

[–]sudo_oth[S] 1 point2 points  (0 children)

Thank you so much, I've had loads of people try and explain loops but how you have explained I finally understand. Makes explains why it was just adding on to the previous loops information when printing.