In <[EMAIL PROTECTED]>, Marc 'BlackJack' Rintsch
wrote:

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

Argh, that fails if the list is empty or contains just one item.

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

Ciao,
        Marc 'BlackJack' Rintsch

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to