s = input("请输入一个字符串: ") n = 0 for i in s: if "A" <= i <= "Z": n = n + 1 print("大写字母的个数是{}".format(n))
如果觉得答案对你有帮助,请点击下采纳,谢谢~