(Nov-18-2017, 05:04 AM)heiner55 Wrote: If you stumble across an easy algorithmn without itertools,
let me know. Thanks.
i have not tested this idea, yet. for a given sequence of n items, iterate over range(1,2**n) as b.. get a string of bits representing b and start an empty list. iterate through this string of bits. for each bit that is 1 get the corresponding element from the given sequence at the same position and append it to the list. when the iteration of bits is done, yield the resulting list (or append it to the big list to be returned).
yes, i am thinking this should be a generator or a stack of generators.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.