Two random lists from one list

Miki Tebeka miki.tebeka at gmail.com
Fri Mar 11 13:25:41 EST 2011


You can use sets:

teamA = set(random.sample(players, 4))
teamB = set(players) - teamA

HTH
--
Miki Tebeka <miki.tebeka at gmail.com>
http://pythonwise.blogspot.com



More information about the Python-list mailing list