题解 | 没法计空格是牛客输入格式问题,下面这个代码在pycharm是可以跑的#计算某字符出现次数#
import sys input = lambda: sys.stdin.readline().strip() a = input().upper() b = sys.stdin.readline().strip('\n').upper() # print(f"a:{a},b:{repr(b)}") print(a.count(b)) ''' num = 0 for c in a: if c == b: num += 1 print(num) '''