String question - find all possible versions of a person's firstname

Jeff Gercken jgercken at gmail.com
Tue Jan 10 13:16:48 EST 2006


This sounds like a homework problem.  You might try splitting the name
at the e's, check the length of the resulting list and do that many
nested loops.

On 1/10/06, Nico Grubert <nicogrubert at gmail.com> wrote:
> Hi there,
>
> I have a string 'Michèle' that represents the firstname of a person.
>
> What's the best way to get all possible versions of this name if I
> consider to use these characters: e, è, é, ê
>
> I'd like to have a function that returns a list of the following names
> when passing 'Michèle' as parameter to it:
>
> 'Michele'
> 'Michelè'
> 'Michelé'
> 'Michelê'
>
> 'Michêle'
> 'Michêlè'
> 'Michêlé'
> 'Michêlê'
>
> 'Michèle'
> 'Michèlè'
> 'Michèlé'
> 'Michèlê'
>
> 'Michéle'
> 'Michélè'
> 'Michélé'
> 'Michélê'
>
>
> Thanks in advance,
> Nico
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list