lists, uppercase?

Brian Quinlan brian at sweetapp.com
Wed Jan 30 23:50:54 CET 2002


 > how can i change a list like this
> [1, 2, 3, 4]
> to
> [4, 3, 2, 1]

>>> a = [1,5,2,3,4]
>>> a.reverse()
>>> a
[4, 3, 2, 5, 1]
 
> how can i get to know if a string is totally uppercase?

>>> 'ABC'.isupper()
1
>>> 'abc'.isupper()
0
>>> '123'.isupper()
0

Cheers,
Brian





More information about the Python-list mailing list