close
.replace()
看程式碼說故事來著:
str = "Hello Andy"
str.replace("Andy", "Lina")
print str
結果:Hello Lina
.format()
print( "{} likes {}") .format("Tom", "Sherry") 結果:Tom likes Sherry
print( "{0} likes {1}") .format("Tom", "Sherry") 結果:Tom likes Sherry
print( "{1} likes {0}") .format("Tom", "Sherry") 結果:Sherry likes Tom
全站熱搜
留言列表