Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
wxjmfauth at gmail.com
wxjmfauth at gmail.com
Wed Oct 17 14:33:30 EDT 2012
Le mercredi 17 octobre 2012 20:28:21 UTC+2, Ian a écrit :
> On Wed, Oct 17, 2012 at 12:17 PM, <wxjmfauth at gmail.com> wrote:
>
> > Not at all, I knew this. In this I decided to program like
>
> > this.
>
> >
>
> > Do you get it? Yes/No or True/False
>
>
>
> It's just bad style, because both 'yes' and 'no' evaluate true.
>
>
>
> if HasDiacritics('éléphant'):
>
> print('Correct!')
>
>
>
> if HasDiacritics('elephant'):
>
> print('Error!')
>
>
>
> Prints:
>
>
>
> Correct!
>
> Error!
>
>
>
> You could replace the test with "if HasDiacritics('elephant') ==
>
> 'yes':", but why force the caller to write that out when the former
>
> test is more natural and less prone to error (e.g. typoing 'yes')?
I *know* all this. In my prev. msg, the goal was to emph. the
usage of *unicode.normalize()".
jmf
More information about the Python-list
mailing list