题解 | #统计字符#

统计字符

https://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5

my_str = input()
count_a = 0
count_s = 0
count_d = 0
count_o = 0

for i in my_str:
    if i.isalpha():
        count_a += 1
    elif i.isspace():
        count_s += 1
    elif i.isdigit():
        count_d += 1
    else:
        count_o +=1

print(count_a)
print(count_s)
print(count_d)
print(count_o)

全部评论

相关推荐

爱看电影的杨桃allin春招:我感觉你在炫耀
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务