发布网友
共2个回答
热心网友
你好,楼主,可以使用字符串的统计函数来完成。
详细代码如下:
w = 'python,我爱python,hello python。'
print("python出现了%s次"%w.count('python'))