Following program is used to sort a list
for i in range(len(q)):
for j in range(len(q)):
if not (q[i] < q[j]):
t = q[i]
q[i] = q[j]
q[j] = t
contents of q are : {-1 2 4}
The output I get has one empty number like:
4
-1
2
i.e. extra number (empty) between 4 and -1. What am I doing wrong?
You want to sort a list?