题解 | #统计大写字母个数#
统计大写字母个数
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
查看11道真题和解析