立即学习:https://edu.csdn.net/course/play/26676/338776?utm_source=blogtoedu
dir (str)可以查看属性
help()查看文档
s='python lesson'
dir(s)
help(s.index)#查看帮助文档
s.index(sub[,start[,end])
s.index('n')
>>5
s,index('n',6)#从第六个开始数
12
a=‘I LOVE PYTHON’
a.split("")
>>["I",'LOVE','PYTHON']
lst=a.split("")
lst
>>["I",'LOVE','PYTHON']
"-".join(lst)
>>‘I-LOVE-PYTHON’
"i like {0} and {1}".format("python","pythysics")
she is {0:4d} years old and {1:.lf}m in height".format(18,1.67)