📜  在文本 python 代码示例中添加变量

📅  最后修改于: 2022-03-11 14:45:36.915000             🧑  作者: Mango

代码示例1
>>> shepherd = "Mary"
>>> string_in_string = "Shepherd {} is on duty.".format(shepherd)
>>> print(string_in_string)
Shepherd Mary is on duty.