Error: "list index out of Range"
I have been struggling to make a working memory task that's basically a letter version of the delayed match to the sample task.
The experiment starts with a fixation, a blank screen and then a series of Capitalized letters are displayed in a clock wise pattern with each letter being displayed for 1500 ms. The number of letters displayed is varied between 4 to 10. After the letter sequence there is a delay that ranges from 1300 ms to 1800 ms. This is followed by a target or a non target screen where the target letter is one of the letter from those previously shown letters but this time they are in non caps version. The subject has to respond whether the letter belonged to those previously shown letters.
On the basis of the description I've made the following design:
ISI (1300-1800: so basically I have 6 levels here i.e., 1300, 1400...1800) X Stimulus_set ( the number of letters i.e., 4,5,6,7,8,9)
I am sorry but I had posted a discussion previously (here) however, due to some research demands I have to make a subtle changes in the experiment.
I have added a inline code to generate the list of letters which is as follows:
letters = list(string.ascii_uppercase)
stim = 
if var.Stimulus_set == 4:
var.stim = random.sample(letters, 4)
elif var.Stimulus_set == 5:
var.stim = random.sample(letters,5)
elif var.Stimulus_set == 6:
var.stim = random.sample(letters,6)
elif var.Stimulus_set == 7:
var.stim = random.sample(letters,7)
elif var.Stimulus_set == 8:
var.stim = random.sample(letters,8)
elif var.Stimulus_set == 9:
var.stim = random.sample(letters,9)
if var.Target == "On":
tar = random.sample(stim, 1)
var.tar_lower = map(str, tar)
var.nontar = None
nontar = random.sample(letters, 1)
nontar = map(str,nontar)
var.tar_lower = None
While running the experiment I seem to get an error saying "list index out of range"
I am not sure what this error means I had looked up into still I am I could not understand the solution
I have attached the experiment file as well
It seems my amateurism in coding is the issue
I would be grateful if someone could help me resolve this and I am pretty open to tough comments t0o