i dont know the code working good outside the codecademy

but here not good i cant define the problem exactly

```
def median (lst):
x=sorted(lst)
avg = int((len(x))/2 -.5)
print(avg)
print(x[avg])
print(sorted(lst))
if avg %2 == 0 :
return x[avg]
else :
print("here")
y = float(x[avg]+x[avg+1])/2
return y
print(median([6, 8, 12, 2, 23]))
```

median([6, 8, 12, 2, 23]) returned 7.0 instead of 8