代码示例:(标识:python_string_format_1)
python_string_format_1.py
age = 63
txt = "My name is Bill, and I am {}"
print(txt.format(age))
运行结果: