2- AX CPT task: Displaying results

I have been able to create the whole task so far except that I am having difficulty displaying and an array of results. I am very new with python. I want my code to count the number of 1-A-X and 2-B-Y selected and display that result.
I assigned 1-A-X and 2-B-Y to ‘left’ selection and other sequences to be either ‘left’ or ‘right’

I tried using if statements but I feel that the subjectresponse would keep overwriting over the trial. I think an array should be used.

Any help would be appreciated.

Hi would you mind sharing your code?