>> "Hello world".count("l") 3 >>> 阅读更多 " />
用字符串的count函数就行了
>>> "1,2,3".count(",") 2 >>> "Hello world".count("l") 3 >>>