Python:格式化输出
name=input("name")
age=input("age")
job=input("job")
salary=input("salary")
info='''
------------info of {0} ------------
name:{1}
age:{2}
job:{3}
salary:{4}
'''.format(name,name,age,job,salary)
print(info)
info1='''
------------info of {_name} ------------
name:{_name}
age:{_age}
job:{_job}
salary:{_salary}
'''.format(_name=name,
_age=age,
_job=job,
_salary=salary)
print(info1)