字符串是一種序列,素有標準的序列操做對字符串用樣適用,字符串是不能夠改變python
格式化操做符,%,左側是格式化字符串,右側是被格式的值,能夠是一個值、元組、字典學習
>>> import math >>> print "%s %s %s" % ("hello", "world", math.pi) hello world 3.14159265359
find: 返回子字符串的位置
join: 將列表中多個元素鏈接起來, 並返回結果
replace: 替換
split: 將字符串分割成多個字符串, 並返回結果
strip: 返回去掉收尾空字符的字符串code