multiply problems. you don't store you sorted list anywhere.
if i have
[4,5,5,4], the length is
4. the indexes: 0, 1, 2, and 3
so what are the two middle indexes? do
b contain the right indexes?
Another problem, dividing an integer by an integer results in an integer. you need to do something with float