Python_字符串次数统计
a = 'kdjflsjdflsnc,nkdooooooo'
print(a.count('o')
//自己傻了,哈哈
>>> count = 0
>>> word = "dkfjlskdjfaaaaa"
>>> for letter in word:
if letter == "a":
count = count + 1
a = 'kdjflsjdflsnc,nkdooooooo'
print(a.count('o')
//自己傻了,哈哈
>>> count = 0
>>> word = "dkfjlskdjfaaaaa"
>>> for letter in word:
if letter == "a":
count = count + 1