Psychopy Loop - Terminating the loop

OS (e.g. Win10): Win11
PsychoPy version (e.g. 1.84.x): PsychoPy 2022.1.4
Standard Standalone? (y/n) If not then what?: yes
What are you trying to achieve?:
I am creating an experiment where a new type of sound stimuli is presented after every 10 sound stimuli.

What did you try to make it work?:
I have created two loops and use the code to terminate the first loop to continue the routine for the second loop:
myCount = myCount + 1
if myCount > 9:
myCount = 0
Loop1.finished = True

What specifically went wrong when you tried that?:
I want all stimuli in the list are represented sequentially, but they kept looping the first 10 stimuli. How can I run through the whole stimuli list in this design? Thank you very much!

Hello TTT

change your code to

myCounter += 1

if myCounter > 9:
    myCounter = 0
    continueRoutine = True
else:
    continueRoutine = False

Best wishes Jens