name = input("name:")
age = input("age:")
job = input("job:")
salary = input("salary:")
info1 = ‘‘‘
---------------------info of %s--------------------
Name:%s
Age:%s
Job:%s
Salary:%s
‘‘‘ % (name,name,age,job,salary)
info2 = ‘‘‘
---------------------info of {_name}--------------------
Name:{_name}
Age:{_age}
Job:{_job}
Salary:{_salary}
‘‘‘.format(_name=name,_age=age,_job=job,_salary=salary)
info3 = ‘‘‘
---------------------info of ‘‘‘ + name + ‘‘‘--------------------
Name:‘‘‘ + name +‘‘‘
Age:‘‘‘ + age
info4 = ‘‘‘
---------------------info of {0}--------------------
Name:{0}
Age:{1}
Job:{2}
Salary:{3}
‘‘‘.format(name,age,job,salary)
print(info1)
print(info2)
print(info3)
print(info4)
原文:http://www.cnblogs.com/sunweigogogo/p/7487618.html