In <[EMAIL PROTECTED]>, Lad wrote:

> I have a sorted list for example [1,2,3,4,5] and I would like to change
> it in a random way
> e.g [2,5,3,1,4] or [3,4,1,5,2]  or in any other way except being
> ordered.

lst = [1, 2, 3, 4, 5]
tmp = list(lst)
while lst == tmp:
    random.shuffle(lst)

If you *really* want to be sure it's not sorted after shuffling.  :-)

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to