Unsupported operand type error in python
<pre><code>def get_word_count(wordlist, final):
    regex = []
    count = [[] for x in xrange(len(wordlist))]
    frequency = []
    regex = makeregex(wordlist)
    for i in range(len(final)-1):
        size = os.stat(final[i]).st_size
        fil = open(final[i])
        if(fil):
            print final[i] + " read!"
            data = mmap.mmap(fil.fileno(), size, access=mmap.ACCESS_READ)
            for j in range (len(wordlist)):
                count[j].append(re.findall(regex[j], data))
        fil.close()
    for k in range(len(wordlist)):
        frequency.append(sum(count[k]))
    print frequency
</code></pre>

<p><code>count</code> is a list of lists and every list has some numbers stored into it. I wish to store the sum of every list as an element to a new list <code>frequency</code></p>

<p>When I run the code I get an error :</p>

<pre><code>Traceback (most recent call last):
File "C:\Users\Animesh\Desktop\_zipf.py", line 52, in &lt;module&gt;
get_word_count(wordlist, final)
File "C:\Users\Animesh\Desktop\_zipf.py", line 32, in get_word_count
frequency.append(sum(count[k]))
TypeError: unsupported operand type(s) for +: 'int' and 'list'
</code></pre>

<p>What should I change in my code ?
Please help</p>
