w3schools
编辑器
运行结果尺寸:
625 x 591
age = 36 name = "John" txt = "His name is {1}. {1} is {0} years old." print(txt.format(age, name))
x
age = 36
name = "John"
txt = "His name is {1}. {1} is {0} years old."
print(txt.format(age, name))
His name is John. John is 36 years old.