I am trying to make a median program. This is my code.
def median(list=[]):
    x = 0
    list = sorted(list)
    if len(list) % 2 == 0:
        b = int((len(list)/2))
        print b
        c = int(len(list)/2)
        x = [list[b-1],list[c]]
        print x
        x = float((x[0]+x[1])/2)
        print str(x)
    else:
        print list[((len(list)//2))]
When I run it, I get this
>>> median([1,2,3,4])
2
[2, 3]
2.0
What is happening?
Please note: I do not want any advice on ways to do it better, I just want help.
 
     
     
    