方法一%运算符
word="python"
print("我喜欢%s"%word)#输出我喜欢python
方法二str.format()方法
print('{0}{1}'.format('PI=','3.1415'))#输出PI=3.1415
方法三使用内置函数format()
word="hi world"
print(format(word,'<'))#<表示左对齐输出hi world
方法一%运算符
word="python"
print("我喜欢%s"%word)#输出我喜欢python
方法二str.format()方法
print('{0}{1}'.format('PI=','3.1415'))#输出PI=3.1415
方法三使用内置函数format()
word="hi world"
print(format(word,'<'))#<表示左对齐输出hi world