返回
前端
分类

python拼接,

日期: 2020-01-02 07:57 浏览次数 : 195

python拼接,

必赢备用网址 ,拼接:

name=zhuhuan

age=23

salary=333

 

info='''

python拼接,。----- 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)

 

拼接: name=zhuhuan age=23 salary=333 info=''' ----- info of %s----- age:%s name:%s salary:%s %(name,age,name,salary) ''' info2=''' ----- info of {_name}----- ag...

拼接:

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)