帮助函数:
>>> help(str.join)
>>> help(str)
>>>
[root@localhost /]# cat zifuchuan.py
#!/bin/python
a='aaaaaaaaaaaaa'
b='bbbbbbbbbbbb'
c=a+b
print c
d=['ddddddd','eeeeeeee','fffffffff']
g=':'.join(d)
h=''.join(d)
print g,h
o=['aaaaa',12,'23']
print ''.join(str(x) for x in o) //生成器表达式,也可列表解析,只不过消耗大
[root@localhost /]#
[root@localhost /]#
阅读(6251) | 评论(0) | 转发(0) |