python,格式化输出示例1

name = input("Input your name:")
age = input("Input your age:")
job = input("Input your job:")
salary = input("Input your salary:")
msg = '''
-----------Info of %s---------------
Name: %s
Age : %s
Job : %s
Salary: %s
-------------------------------------
''' %(name,name,age,job,salary)
print(msg)

执行结果如下:

Input your name:Guoming Liu
Input your age:48
Input your job:professor
Input your salary96000

-----------Info of Guoming Liu---------------
Name: Guoming Liu
Age : 48
Job : professor
Salary: 96000
-------------------------------------

posted @ 2019-11-13 13:03  Iceberg_710815  阅读(341)  评论(0编辑  收藏  举报