📜  字符串python代码示例中的变量字符串

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

代码示例1
>>> shepherd = "Mary"
>>> age = 32
>>> stuff_in_string = "Shepherd {} is {} years old.".format(shepherd, age)
>>> print(stuff_in_string)
Shepherd Mary is 32 years old.