string,list,tuple

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(参数的开始和结束被解释为切片符号)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值