| ||||
shuffling Posted by admin (Graham Ellis), 19 April 2004 Question - how do I re-arrange the elements in a list into a random order (e.g. to shuffle a pack of cards, or to arrange the tracks on a CD into a random order for playing each once?)Answer - use the power of a Python module - in this case the random module which includes a shuffle fucntion that does exactly what you need. Code:
This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
| ||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |