格式化输出
作者:互联网
#__author: han-zhang
#date: 2018/11/23 0:57
#file: 格式化输出.py
#IDE: PyCharm
name=input("请输入您的名字:")
age =int(input("请输入您的年龄:"))
sex=input("请输入您的性别:")
job=input("请输入您的工作:")
salary=input("请输入您的月薪:")
if salary.isdigit(): #长的像不像数字
salary = int(salary)
else:
# print("is must disit")
exit("is must disit") #退出程序
msg='''
-------- in info %s ----------
name: %s
age : %s
sex : %s
job : %s
salary:%s
-------- end --------
''' % (name,name,age,sex,job,salary)
print(msg)
标签:salary,输出,格式化,name,sex,job,input,输入您 来源: https://blog.csdn.net/weixin_42590877/article/details/88357802