python Programming Glossary: sub_combinations
Yielding sub combinations http://stackoverflow.com/questions/8646186/yielding-sub-combinations which returns subsegments for a given segment. For example sub_combinations ABCD should yield A B C D A B CD A BC D A BCD AB C D AB CD ABC.. order and B follows AC . This is as far as I've gotten def sub_combinations segment for i in range 1 len segment for j in sub_combinations.. segment for i in range 1 len segment for j in sub_combinations segment i yield segment i j yield segment for i in sub_combinations..
|