mix up a string

Skip Montanaro skip at pobox.com
Sun Jun 5 16:51:04 EDT 2005


    rbt> mix = random.shuffle('dog')

Try:

    lst = list('dog')
    random.shuffle(lst)
    print "".join(lst)

Skip



More information about the Python-list mailing list