lowest index:最小索引开始
Optional:可选择的
interprete:解释
slice:切开,切片
notation:符号
split:分离,分开
whitespace 空白
leading and trailing whitespace 开头和结尾 空白
occurrences:出现
Return number of occurrences of value.返回值出现的次数。
s1=(“hello world”) 字符串定义
li=[1, 2, 3] 列表定义
b = list(‘11’) 列表定义
print(b)
[‘1’, ‘1’]
tu = (1,2,3.4.5) 元组 不能增删减tuple
print(s4.find(‘e’))
print(s4.index(‘e’))
区别:# 未找到 index 报错 find -->-1
name[ : : -1] 字符串反向。步长-1
def find(self, sub, start=None, end=None): # real signature unknown; restored from __doc__
"""
S.find(sub[, start[, end]]) -> int
Return the lowest index in S where substring sub is found,(返回S中找到子字符串子的最低索引)
such that sub is contained within S[start:end]. (使sub包含在S[start:end]中) Optional arguments start and end are interpreted as in slice notation(参数的开始和结束被解释为切片符号)