兰帕德布劳内

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
website = "http://www.%s.org"
value = ("python")
print (website % value)

s = Template("hello,$x")
print (s.substitute(x = "sean"))

 find用法

"This morning, he's going to walk down the front steps".find("walk")

lower用法

"This morning, he's going to walk down the front steps".lower()

replace用法

"This morning, he's going to walk down the front steps".replace("o","$")

split用法

"1+2+3+4+5".split("+")
['1', '2', '3', '4', '5']

strip用法

"Peter   ".strip()

删除前后空格

 

posted on 2016-09-15 23:12  兰帕德布劳内  阅读(46)  评论(0)    收藏  举报