from ctypes import sizeof import sys str = list(input().upper()) symbol = input().upper() count = str.count(symbol) print(count) 主要两个函数1、使用upper() / lower() 函数将输入字符串和字符都转为同样的大写或者小写字符;2、使用count函数直接统计字符出现的次数