The code below runs perfectly in python 2 but when I run it in python 3 the console returns an error saying : " total=(sorted_list[first]+sorted_list[second])/2.0

TypeError: list indices must be integers or slices, not float"

I wish to know if I missed something and make the code run.Thanks

```
median=[]
def median(lists):
sorted_list=sorted(lists)
if len(sorted_list)==1:
return sorted_list[0]
elif len(sorted_list)%2==0:
first= len(sorted_list)/2-1
second= first+1
total=(sorted_list[first]+sorted_list[second])/2.0
return total
else:
first=len(sorted_list)/2
total=sorted_list[first]
return total
print median([29,23,27,28,25,23])
```