Find the Median

  • + 0 comments
    def findMedian(a):
     # Write your code here
        m=0
        a.sort()
        f=[]
        l=[]
        le=len(a)
        if le%2!=0:
            m=le//2
            return a[m]
        elif le%2==0:
            t=le//2
            f=a[:t]
            l=a[t:]
            return (f[-1]+l[0])/2