[Tutor] Permutations? (original) (raw)
Rich Krauter rmkrauter at yahoo.com
Sun Jul 25 17:39:07 CEST 2004
- Previous message: [Tutor] Permutations?
- Next message: [Tutor] Permutations?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sun, 2004-07-25 at 10:21, Rich Krauter wrote:
You could just call your function as-is with a slice of the original list, and then append the initial list element(s) to the results: lst = [0,1,2,3] results = perm(lst[1:]) print map(lambda res,i=lst[0]:[i]+res,results)
Sorry, Brian. I see you suggested something similar in your first reply.
Rich
- Previous message: [Tutor] Permutations?
- Next message: [Tutor] Permutations?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]