题解 | #子串的数量#
子串的数量
https://www.nowcoder.com/practice/f7f7734369534fd7b322033fde39ee6a
a=input() b='Niu' print(a.count(b)) # Python count() 方法用于统计字符串里某个字符或子字符串出现的次数。可选参数为在字符串搜索的开始与结束位置。 # str.count(sub, start= 0,end=len(string))
子串的数量
https://www.nowcoder.com/practice/f7f7734369534fd7b322033fde39ee6a
a=input() b='Niu' print(a.count(b)) # Python count() 方法用于统计字符串里某个字符或子字符串出现的次数。可选参数为在字符串搜索的开始与结束位置。 # str.count(sub, start= 0,end=len(string))
相关推荐