标签:次数 board NPU 字符 count 字符串 inpu lower 个数
输入一个字符串和一个字符,统计这个字符在字符串中出现的次数
输入2行。第1行是字符串,第2行是要查找的字符。
字符出现的次数
abcdefgabcdefg
a
2
a=input()
b=input()
def CountAa(s):
return s.lower().count(b)
if __name__ == "__main__":
s = a
print(CountAa(s))
标签:次数 board NPU 字符 count 字符串 inpu lower 个数
原文地址:https://www.cnblogs.com/SkystarX/p/12334052.html