python如果想输出原格式的内容,可以加''' ''',占位符使用方式

print('我考了%d分'%20)
msg='''
---------info of %s-----------
name: %s
age: %d                           #字符串不能放到%d处
job: %s
salary: %f
you will be retired in %s years   #数字可以放到%s处
---------end---------------
'''%('tom','tom',20,'it',3444.44,45)
print(msg)

 

posted @ 2018-08-01 19:48  香蕉都驼背  阅读(1483)  评论(0编辑  收藏  举报