lists, uppercase?

Alex Martelli aleax at aleax.it
Wed Jan 30 18:29:38 EST 2002


Brian Quinlan wrote:
        ...
>> how can i get to know if a string is totally uppercase?
> 
>>>> 'ABC'.isupper()
> 1
>>>> 'abc'.isupper()
> 0
>>>> '123'.isupper()
> 0

Just be aware of one anomaly: ''.isupper() is 0.


Alex




More information about the Python-list mailing list