Getting the error unorderable types: int() >= list()
<p>I am new to python. I am trying to write the python code for mergesort and i unable to locate the error.</p>

<pre><code>import math
t = int(input())

def merge(lf,rf):
    p=0
    q= 0    
    b=[]
    for i in range(len(rf)+len(lf)):    
        if (p&gt;=len(lf)):
            b.append(rf[q:])
            break
        elif (q&gt;=len(rf)):
            b.append(lf[p:])
            break
        elif (lf[p]&gt;=rf[q]):
            b.append(rf[q])
            q=q+1
        else:
            b.append(lf[p])
            p=p+1
    return b


def sort(a):
    if (len(a)&gt;1):
        mid = int(len(a)/2)
        lf=a[:mid]
        rf=a[mid:]
        lf=sort(lf) 
        rf=sort(rf)
        a=merge(lf,rf)
        print (a)
    return a

for i in range(t):
    n = int(input())
    a = [0]*n
    for j in range(n):
        a[j]=int(input())
    sort(a)
    print(a)
</code></pre>

<p>When you do either <code>b.append(rf[q:])</code> or <code>b.append(lf[p:])</code>, you adding a <em>list</em> as an element to the list <code>b</code>, which looks like it should be a list of integers.</p>

python