Selecting random elements from a list.

Timothy Grant timothy.grant at gmail.com
Mon Oct 13 17:45:03 EDT 2008


On Mon, Oct 13, 2008 at 2:29 PM, aditya shukla
<adityashukla1983 at gmail.com> wrote:
> Hello folks,
>
> i have a list say list1=[a,b,c,...z] ie 26 elements i have to take 5
> elements from it randomly and save in another list.Please explain how to do
> this?
>
>
> Aditya
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>


I would start here http://docs.python.org/library/random.html  you are
likely interested in choice or sample.

-- 
Stand Fast,
tjg.  [Timothy Grant]



More information about the Python-list mailing list