标签:for nbsp orm format python highlight int eal name
1.format() 字典方式
test = ‘I am {name},age{a}‘ #v = test.format(name = ‘alex‘,a =19) v = test.format(**{"name" : ‘alex‘,"a":19}) print(v) _____________________________ I am alex,age19
2.
test = ‘I am {0},age{0}‘ # v = test.format(name = ‘alex‘,a =19) #v = test.format(**{"name" : ‘alex‘,"a":19}) v = test.format(‘alex‘,19) print(v) ———————————— I am alex,agealex
标签:for nbsp orm format python highlight int eal name
原文地址:https://www.cnblogs.com/jijianhu/p/10337367.html