[pyar] cadenas de texto

p8queen p8queen en gmail.com
Lun Jul 4 09:38:12 ART 2011


#!/usr/bin/python

str = "THIS IS STRING EXAMPLE....WOW!!!";
print str.isupper();

str = "THIS is string example....wow!!!";
print str.isupper();

fuente: http://www.tutorialspoint.com/python/string_isupper.htm

Si queres saber cuantos caracteres son mayusculas ?

cad  = "Hola Mundo"
sum([x.isupper() for x in cad])


Esto es "a la python" .

-- 
Gustavo C



More information about the pyar mailing list