#通过关键字映射
print('I am {name},age {age}'.format(name='qiqi齐',age=18))#I am qiqi齐,age 18
dictory={'name':'xiaozhi志','age':19}
s='{name} is {age} years old'.format(**dictory)
print(s)#xiaozhi志 is 19 years old
#通过位置映射
s1='I am {0},age {1},name {0}'.format('guang光',20)
print(s1)#I am guang光,age 20,name guang光
s2='I am {0},age {1},name {0}'.format(*["alex",22])
print(s2)#I am alex,age 22,name alex