def getMedian(alist):
 tmp = list(alist)
 tmp.sort()
 alen = len(tmp)
 if ((alen % 2) == 1):
  return tmp[(alen // 2)]
 else:
  return ((tmp[(alen // 2)] + tmp[((alen // 2) - 1)]) / 2)

def getMedian ( alist ) : tmp = list ( alist ) tmp . sort ( ) alen = len ( tmp ) if ( ( alen % 2 ) == 1 ) : return tmp [ ( alen // 2 ) ] else : return ( ( tmp [ ( alen // 2 ) ] + tmp [ ( ( alen // 2 ) - 1 ) ] ) / 2 )
get median of list .