public string GetString(string str)
{
int A = 0;
int a = 0;
int x = 0;
for (int i = 0; i < str.Length; i++)
{
int t = (int)str[i];
if (t >= 65 && t <= 90)
A++;
else if (t >= 97 && t <= 122)
a++;
else
x++;
}
return string.Format("大写字母的个数:{0}个;小写字母的个数:{1}个;其它字符的个数:{2}个;", A, a, x);
}
#!python
import string
meter = {'upper':0, 'lower':0, 'other':0}
for a in st:
type = 'upper' if a in string.uppercase else (
'lower' if a in string.lowercase else 'other')
meter['type'] += 1