题解 | #统计大写字母个数#

统计大写字母个数

https://www.nowcoder.com/practice/434414efe5ea48e5b06ebf2b35434a9c

while True:
    try:
        strings = input()
        chars_upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
        count = 0
        for i in strings:
            if i in chars_upper:
                count += 1
        print(count)
    except:
        break

全部评论

相关推荐

2025-12-22 21:12
门头沟学院 Java
码农索隆:看得出来,公司对你挺满意哦。 但是你要结合一下自己的职业发展看下,眼光要放长远了看
点赞 评论 收藏
分享
02-11 14:29
已编辑
字节跳动_QA
Edgestr:这种的写代码最狠了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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