python之字符串格式化

name = input("name:")
age = input("age:")
job = input("job:")
salary = input("salary:")
msg = '''
-----------information of %s------------
name:%s
age:%s
job:%s
salary:%s
----------------end-----------------------
'''%(name,name,age,job,salary)
print(msg)

打印结果:

 

posted @ 2019-11-15 15:51  小红帽与大灰狼  阅读(119)  评论(0编辑  收藏  举报