格式化输出

 

  

"""
name=input("please enter your name:")
hobby=input("please enter your hobby:")
job=input("please enter your job:")
msg="my name is %s hobby is %s job is %s" %(name,hobby,job)
print(msg)

"""
"""


name=input("please enter your name:")
hobby=input("please enter your hobby:")
job=input("please enter your job:")
msg="""--------information_of_%s-------
name : %s
hobby : %s
job : %s
-------------"""%(name,name,hobby,job)
print(msg)

"""
"""
#% 相当于占位符,s是指string,d时digit,是整数代表的是数字
#如果想要输出工作的进度,如3%,则需要再加一个%进行转义,例如
#对于%的转义,只需打两个%即可,它会把第一个%后的进行转义,若要表示%s则可以写为%%s

"""
name=input("please enter your name:")
hobby=input("please enter your hobby:")
job=input("please enter your job:")
msg="""--------information_of_%s-------
name : %s
hobby : %s
job : %s
job schedule : 6%%
-------------"""%(name,name,hobby,job)
print(msg)
"""

 

上一篇:2019-2020-1 20199329《Linux内核原理与分析》第五周作业


下一篇:element-ui 提交from表单卡住了 [Element Warn]please pass correct props!