[Tutor] removing items from list

Dennis Lee Bieber wlfraed at ix.netcom.com
Mon Feb 7 12:51:11 EST 2022


	My apologies for jumping directly to the itertools module solution...
I'm not quite awake yet. I should have rather looked for some page defining
the algorithm for computing combinations (and/or permutations). {Though I'm
finding lots for permutations, not as many for combinations...
https://stackoverflow.com/questions/127704/algorithm-to-return-all-combinations-of-k-elements-from-n
seems the most packed}

	And perhaps combinations is not the desired result (though with that
erroneous attempted reset of the list on each pass, combinations made more
sense than a continuously shrinking list as the latter is somewhat poorly
defined: remove from front, remove from end, remove at random?, or even
recursively do reducing combinations on each combination).


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/



More information about the Tutor mailing list