python统计字符出现的次数
1、新建文件
python编辑器中,点击“File—New File”,新建文件。

2、输入代码
str= "wihgohglsjfawjohrnglndvshuaehfsnflsfn"
s= str.count("f")
print(s)
代码的意思是统计字母f在字符串str中出现的次数。

3、运行文件
点击“Run—Run Module”,按提示保存文件后运行文件。

4、输出结果
就可以运行代码输出统计结果了。

阅读量:158
阅读量:118
阅读量:160
阅读量:192
阅读量:173