str = input("请输入一个字符串:")
length1 = len(str)
letter = 0
digit = 0
others = 0
print(length1)
i = 0
for each in str:
str1 = str[i]
i += 1
if str1.isalpha():
letter += 1
elif str1.isdigit():
digit += 1
else:
others += 1
print("字母有%d个,数字有%d个,其他字符有%d个" % (letter, digit, others))
12-22
12-22
12-25
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交