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
-------------------------------------