📜  如何将变量插入字符串而不破坏python代码示例中的字符串

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

代码示例1
name = "Dan"
age = 21
#you need to have that "f" before the string
name_and_age = f"My name is {name}, and I am {age} years old."
print(name_and_age)