Python请定义函数 count(str,c),统计字符串 str中单个字符 c出现的次数,并设?

如题所述

def count(str,c):
flag=0
for i in str:
if i==c:
flag+=1
return flag
温馨提示:答案为网友推荐,仅供参考