Re: Generating all ordered substrings of a string

2006-07-13 Thread Thorsten Kampe
* Thorsten Kampe (2006-07-12 19:11 +) > filter(lambda x: len(x) == 2, part(['abcd'])) That's "filter(lambda x: len(x) == 2, part('abcd'))" of course... -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating all ordered substrings of a string

2006-07-12 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > Hi, > I want to generate all non-empty substrings of a string of length >=2. > Also, > each substring is to be paired with 'string - substring' part and vice > versa. > Thus, ['abc'] gives me [['a', 'bc'], ['bc', 'a'], ['ab', 'c'], ['c', > 'ab'], ['b', 'ac'], ['ac', 'b

Re: Generating all ordered substrings of a string

2006-07-12 Thread Thorsten Kampe
* [EMAIL PROTECTED] (2006-07-11 10:20 +) > I want to generate all non-empty substrings of a string of length >=2. > Also, > each substring is to be paired with 'string - substring' part and vice > versa. > Thus, ['abc'] gives me [['a', 'bc'], ['bc', 'a'], ['ab', 'c'], ['c', > 'ab'], ['b', 'ac

Re: Generating all ordered substrings of a string

2006-07-12 Thread Tal Einat
[EMAIL PROTECTED] wrote: > Hi, > I want to generate all non-empty substrings of a string of length >=2. > Also, > each substring is to be paired with 'string - substring' part and vice > versa. > Thus, ['abc'] gives me [['a', 'bc'], ['bc', 'a'], ['ab', 'c'], ['c', > 'ab'], ['b', 'ac'], ['ac', 'b

Re: Generating all ordered substrings of a string

2006-07-11 Thread girish
Quoting Bruno Desthuilliers <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] a écrit : > > Hi, > > I want to generate all non-empty substrings of a string of length > >=2. > > Also, > > each substring is to be paired with 'string - substring' part and vice > > versa. > > Thus, ['abc'] gives me [['a', 'b

Re: Generating all ordered substrings of a string

2006-07-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, > I want to generate all non-empty substrings of a string of length >=2. > Also, > each substring is to be paired with 'string - substring' part and vice > versa. > Thus, ['abc'] gives me [['a', 'bc'], ['bc', 'a'], ['ab', 'c'], ['c', > 'ab'], ['b', 'ac'], ['ac',

Generating all ordered substrings of a string

2006-07-11 Thread girish
Hi, I want to generate all non-empty substrings of a string of length >=2. Also, each substring is to be paired with 'string - substring' part and vice versa. Thus, ['abc'] gives me [['a', 'bc'], ['bc', 'a'], ['ab', 'c'], ['c', 'ab'], ['b', 'ac'], ['ac', 'b']] etc. Similarly, 'abcd' should give