In your code line:
if l[index] < l[index + 1]:
use:
if l[index] > l[index + 1]:
for ascending sort order.
BTW, programmers avoid using the letter l for a variable name, since it looks so much like 1.
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417