I'm trying to create a list that works as a counter, such as every time an event happens, a number is added to it to keep track of how often it occurs. It would work as an index towards a list more or less.

I'm new to python, which is why some may see my code as spaghetti-code.

I have my main class calling for an array class that's 0-50 indexes long to create an object of it. It also initiates the counter with the value 0 for the object as seen below.

```
def __init__(self):
    self._table = Array((0,), (50,))
    self._counter = 0

```

I run this method, taking the value of `key` and `obj`, to populate the array object. However, when entering the parameters to the method `enter_value()`, it gives the error saying that `TypeError: 'int' object is not subscriptable`.

```
def populate_test(self, key, obj):
    for i in range(len(self._table._array)):
        self._table.enter_value(self._counter, (key, obj))
        self._counter = self._counter + 1

```

This is the *enter\_value* method.

```
def enter_value(self, index, value):
    for i in range(len(self._table._array)):
         ###Here's where the error occurs
         if (index[i] < self._low[i]) or (index[i] > self._high[i]):
             //Do something

```

From what I've learned, a subscriptable object is something that works as a list or dictionary. Does my error occur because of the `index[i]` since my counter is an `int` object and not actually a list? If that's the case, as to my question regarding this post, is there a way for me to create the list that would work as a counter that's better?