This is the code I am using.

def median(lst):

ans = sorted(lst, key = int)

wer = ""

while len(ans) != 1:

if len(ans) == 2:

break

ans.pop(0)

ans.pop(len(ans) - 1)

for n in ans:

wer += str(n)

return int(wer)

The error message returned is Oops, try again. median([4, 5, 5, 4]) returned 45 instead of 4.5

I know this probably has a simple answer but I can't seem to find it out. Please help if you can.