立即学习:https://edu.csdn.net/course/play/26676/338776?utm_source=blogtoedu
help(s.index) means show the method of s's index
s = "python lesson"
s.index('n') gives 5
n is the 5th letter in the str
s.index('n', 6) gives 12, means search from the 6th letter till last
a = "I LOVE PYTHON"
if need to split it into words, use split
a.split(" ") gives ['I', 'LOVE', 'PYTHON']
lst = a.split(" ")
"-".join(lst) gives 'I-LOVE-PYTHON'
- is used to put them together
-----------------------------------------
"I like {0} and {1}".format("python","physics")
gives 'I like python and pysics'
"I like {0:10} and {1:>15}".format(同上)
然后第一个空左对齐第二个右对齐
d的意思是整数