python:字符串拼接
用python字符串拼接时可以用加号,也可以用三引号
三引号如下:
name = input("name: ")
age = input("age: ")
sex = input("sex: ")
num = input("num: ")
info = '''
--------information of %s----------
name = %s
age = %s
sex = %s
num = %s
''' %(name,name,age,sex,num)
info1 = '''
--------information of {0}----------
name = {0}
age = {1}
sex = {2}
num = {3}
'''.format(name,age,sex,num)
print(info,info1)