Resetting Accuracy Value for Practice Trials

Hi I am working on a Psychopy experiment testing working memory. Right now I am focusing on the practice condition that contains a total of 10 trials. I have figured out the code component in order to have the practice condition end once the participant reaches an accuracy of 80% and at least 8 trials total.
Question: However, I am having difficulty with having that accuracy value reset to 0 after a total of 10 trials, in which the participant will then repeat the practice trial until they reach 80% accuracy.
Could anyone help me out this how to insert this code? Here is what I have so far:

otal_trials = total_trials + 1

count_acc = count_acc + response.corr
avg_acc = count_acc / total_trials
if(avg_acc >= 0.80 and total_trials >=8): 
    Practice.finished = True

I would set the practice loop to have 10 iterations (whether by having a conditions file of 10 rows or setting nReps in the loop dialog to be 10).

Then insert a second, outer loop around it. Set it to have a large nReps (like 100). Don’t connect it to a conditions file. In your code when you end the practice loop, end the outer one too. That should give you what you want.