I had a task in a book to pick 5 items from a list of 26 ensuring the items are not repeated
import random list = ['a','b','c','d','e','f','g','h','i','j','k','l','m', 'n','o','p','q','r','s','t','u','v','w','x','y','z'] word = ' ' a = random.choice(list) list.remove(a) b = random.choice(list) list.remove(b) c = random.choice(list) list.remove(c) d = random.choice(list) list.remove(d) e = random.choice(list) list.remove(e) word = a + b + c + d + e print (word) print(list)
-- http://mail.python.org/mailman/listinfo/python-list