题解 | #统计字符#

统计字符

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

in_str = str(input())
count_alp = 0
count_emp = 0
count_dig = 0
count_oth = 0
for i in in_str:
    if(i.isalpha()):
        count_alp += 1
    if(i.isdigit()):
        count_dig += 1
    if(i == " "):
        count_emp += 1
print(count_alp)
print(count_emp)        
print(count_dig)
print((len(in_str)-count_alp-count_emp-count_dig))

全部评论

相关推荐

迷茫的大四🐶:自信一点,我认为你可以拿到50k,低于50k完全配不上你的能力,兄弟,不要被他们骗了,你可以的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务