I've change the code and I think I have what you were talking about.

def mysort(list_):

for i in xrange(0, len(list_)):

pos = i

for j in xrange(pos+1, len(list_)):

if list_[i] > list_[j]:

pos = j

                list_[i], list_[j] = list_[j], list_[i]

I finally started to think that the while couldn't remain. But if I look at this the thing that I don't get is the 'xrange(pos+1, len(list_))' snippet. What confused me was how did a new position get passed xrange(), when I do not see where it that was happening. Is 'pos' a reference to the original pos in the xrange snippet?

T
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to