哈喽,有用请点采纳~
s = input()
str_upper, str_lower, n = 0, 0, 0
for i in s:
if i.islower():
str_lower += 1
elif i.isupper():
str_upper += 1
elif i.isdigit():
n += 1
print(str_upper)
print(str_lower)
print(n)
用请点采纳
代码:
输出:
strs = input("请输入统计字符串:")
lower_count = 0
upper_count = 0
num_count = 0
for item in strs:
if item.islower():
lower_count += 1
if item.isupper():
upper_count += 1
if item.isdigit():
num_count += 1
print(upper_count, lower_count, num_count, sep=',')