Q:

Python: Using a For Loop and random function in statistical probabiltiy model

I have been set a task, to using an original Dataset of 25 A's and C's (50 data points in total), to randomly select 1 of the 50 data points then add this to a new nested list and to repeat this 50 times (length of dataset). This random selection then needs to be done again with the new dataset, for 25 times. 
import random
SetSize = 50
StatData = [[] for b in range(1,50)]
    for i in range(0, int(SetSize/2)):           
StatData[0].append('A') 
    for i in range(int(SetSize/2)):           
StatData[0].append('C')

for a in range(1,25):
    for b in range(0, int(SetSize)):
        StatData(a+1).append(random.choice(StatData[a]))

This is my current piece of code, so i have created the empty nested list, created the initial dataset (StatData0) however the next section is not working it is returning
    "TypeError: 'list' object is not callable"
Any help would be much appreciated! 

A:

The error says it all. You cannot call a list.
Typo
On the last line of the code you provided, change
StatData(a+1).appen...

to
StatData[a+1].appen...

and I guess it should fix the error.
Index problem (edit)
You are populating the list of index 0 with As and Bs (StatData[0]) but in your last loop a goes from 1 to 50. So your first iteration will choose a random character in StatData[1] (which is empty) thus throwing another error.
Starting your loop from the index 0 should make this go away !

