Python的占位符主要用于用变量替换字符串的内容,从而建立更加灵活和多样化的内容。
代码:
a="Good"
b= "Morning"
c= "Haley"
print("%s %s %s" %(a,b,c))
结果
Good Morning Haley
Python的占位符主要用于用变量替换字符串的内容,从而建立更加灵活和多样化的内容。
代码:
a="Good"
b= "Morning"
c= "Haley"
print("%s %s %s" %(a,b,c))
结果
Good Morning Haley