Q: define many variables from the elements in a list I want to define 500 variables. All the them should be a random number generated from a binomal distribution. Then I would like to show each of them in HTML page. 
My code as below:
# draw a number from the distribution
def a1s1(self):
    return 3 * np.random.binomial(1, 0.3)

# get rid of the decimal point
def a1s1int(self):
    return int(self.a1s1())

# define 500 variables
number1 = models.FloatField()
number2 = models.FloatField()
....# this should continue in this way until "number500"

# generate a list of 500 random numbers
def drawnumbers(self):
    rnlist = []
    numbers = dict()
    for i in range(1, 500):
        numbers[i] = self.a1s1int()
        rnlist.append(numbers)
    return numbers

# to get each element from the list
number1 = self.drawnumbers[1]
number2 = self.drawnumbers[2]

This gave me the error:
NameError: name 'self' is not defined

sometimes I got another error "NoneType" is not callable.
Could you please help? I am really new to Python. Many thanks.

A: It's better to directly build the list :
number=[int(3*np.random.binomial(1,0.3)) for i  in range(500)]

You can access them by number[23] for exemple. 
