Quantcast
Channel: Snow Blog » python
Viewing all articles
Browse latest Browse all 4

python学习笔记之字符串

0
0

字符串格式化:
format = “hello %s, %s enough for ya?”
values = (‘world’,’hot’)
print format % values
结果:hello world, hot enough for ya?
注:如果不是在命令行执行,把print后面的用括号括起来

与php类似但函数或方法名不一样的地方:
php explode=> python split
php trim => python strip
php implode => python join


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images