字符串格式化:format = “hello %s, %s enough for ya?”values = (‘world’,’hot’)print format % values结果:hello world, hot enough for ya?注:如果不是在命令行执行,把print后面的用括号括起来
与php类似但函数或方法名不一样的地方:php explode=> python splitphp trim => python stripphp implode => python join
原文地址:python学习笔记之字符串, 感谢原作者分享。 想象困难做出的反应,不是逃避或绕开它们,