python拼接

拼接:

name=zhuhuan

age=23

salary=333

 

info='''

----- info of %s-----

age:%s

name:%s

salary:%s

 %(name,age,name,salary)

'''

info2='''

----- info of {_name}-----

age:{_age}

name:{_name}

salary:{_salary}

'''.format(_name=name,_age=age,_salary=salary)

info3='''

----- info of {0}-----

age:{1}

name:{0}

salary:{2}

'''.format(name,age,salary)

print(info,info2,info3)

 

posted @ 2017-09-13 21:30  zhuh  阅读(168)  评论(0编辑  收藏  举报