📌  相关文章
📜  python 计数代码,计算给定子字符串的出现次数 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:28.343000             🧑  作者: Mango

代码示例1
# define string
string = "Python is awesome, isn't it?"
substring = "is"

count = string.count(substring)

# print count
print("The count is:", count)