第1个回答 2019-07-09
1、python 下面的str是一个类,里面包含各种方法,其中之一就是find()
源码如下,这个类如果全部放上来,会超过最大字数限制,里面解释内容太多了
def find(self, sub, start=None, end=None): # real signature unknown; restored from __doc__
"""
B.find(sub[, start[, end]]) -> int
Return the lowest index in B where subsection sub is found,
such that sub is contained within B[start,end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
"""
return 0