输入一个字符串统计字符串中的大写字母个数并输出。要求用函数实现统计大写字母个数的功能。
def count(s): count = 0 for i in s: if i.isupper(): count += 1 return count
s = input() print(count(s))
原文地址: https://www.cveoy.top/t/topic/g0hd 著作权归作者所有。请勿转载和采集!