def median(arg):

s=0

k=0

median1=0

ran=len(arg)/2

odd=len(arg)

arg.sort()

```
if len(arg)%2==0 and len(arg)!=0:
#print ("The indices are ",(ran,ran+1))
s=arg[int(ran)-1]
#print ("S is ",s)
k=arg[int(ran)]
#print ("K is ",k)
median1=(s+k)/2
#print median1
else:
if len(arg)!=0 and len(arg)%2!=0:
s=arg[int(odd)-1]
print ("s value is ",s)
median1=s
return median1
```

print (median([4,5,5,4]))