help me debug my "word capitalizer" script

Rebelo puntabluda at gmail.com
Wed Aug 22 10:46:04 EDT 2012


> Let's move to Bug #2:
> 
>  2. How do I escape the words that are already in uppercase? For example:
> 
> 
> 
> The input file has this:
> 
> NASA
> 
> 
> 
> The script changes this to:
> 
> Nasa
> 
> 
> 
> Is it possible to make this script look at a word, see if its first
> 
> character is capitalized, if capitalized then skip that word. If not
> 
> do the processing? I don't wan to use regex? Do I need it?

change: 
 words[i] = word.capitalize() 

into:
if word != word.upper() :
     words[i] = word.capitalize() 



More information about the Python-list mailing list