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

统计大写字母个数

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

# check_str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
while True:
    try:
        s = input()
        count = 0
        for c in s:
#             if c in check_str:
            if c.isupper():#判断是否大写字母
#             if c >= 'A' and c <= 'Z':
                count += 1
        print(count)
    except:break

全部评论

相关推荐

08-21 16:35
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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