I tried the following code, and the results are given below that. I know of other methods, but I'd like to know why this one fails.
l=list(input("Enter a list:"))
for a in l:
for b in l:
if a>=b:
break
else:
print(a,l.index(a))
Result:
Enter a list:3,2,4,5
, 1
2 2
, 1
, 1