标签:salary,name,python,引号,第一章,job,info1,input,age From: https://www.cnblogs.com/cyg02/p/16921789.html
#用2种方式拼接信息,第一种为常用方式
name = input("name:")
age = input("age:")
job = input("job:")
salary = input("salary:")
info1= '''
--------------------info1 of {_name}-------------
name = {_name}
age = {_age}
job = {_job}
salary = {_salary}
'''.format(_name=name,_age=age,_job=job,_salary=salary)
info2 = '''
------------------------info2 of %s--------------#其中%s是占位符,有几个参数就有几个占位符
name = %s
age = %s
job = %s
salary = %s
'''%(name,name,age,job,salary)
print(info1,info2)