TypeError: 'int' object is unsubscriptable in python
<pre><code> &gt;&gt;&gt; def merge(l1,l2):
        top1=0
        top2=0
        while l1[top1]!=None or l2[top2]!=None:
            if l1[top1]&gt;l2[top2]:
                l.append(11[top1])
                top1=top1+1
                print "added"+l1[top1]
            else:
                l.append(l2[top2])
                top2=top2+1
                print "added"+l2[top2]
        return l

 &gt;&gt;&gt; merge(l1,l2)

Traceback (most recent call last):
  File "&lt;pyshell#58&gt;", line 1, in &lt;module&gt;
    merge(l1,l2)
  File "&lt;pyshell#57&gt;", line 6, in merge
    l.append(11[top1])
TypeError: 'int' object is unsubscriptable
</code></pre>
