%s占位符 format
print "my name is: %s" %"xiaoming"
结果:my name is: xiaoming
后面跟2个参数,可以用小括号,3个参数也是在括号中加
print "my name is: %s %d"%("33",55)
结果:
my name is: 33 55
用format格式
a = 'pyer'
b = 'apple'
print "my name is:{},i love {}" .format(a,b)
前面写大括号,后面加 点format