Python学习----格式化字符串

say3='there are %d monkey in the %s !
print(say3 % (5,'tree'))
-----------------------------------
d1=(3,'tree')
d2=(5,'water')
print(say3 % d1)
print(say3 % d2)

猜你喜欢

转载自blog.csdn.net/printfsome/article/details/81077465