题解 | #蛇形矩阵#

统计字符

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

s = input()
letter_count = 0
space_count = 0
number_count = 0
other_count = 0
for i in s:
    if i.isalpha():
        letter_count += 1
    elif i == " ":
        space_count += 1
    elif i.isalnum():
        number_count += 1
    else:
        other_count += 1
print(letter_count)
print(space_count)
print(number_count)
print(other_count)
    

全部评论

相关推荐

HoePointer:把重点可以标黑,简历精简一下,然后把你的项目放在 github 或者 gitee 上面,readme 写好看一点(一般面试官有可能会翻你的网页)
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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