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

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

代码示例1
variable_1 = "Python"
variable_2 = "Django"
age = 20

# insert variables into string using f-string
insert_var = f"Hello {variable_1} and {variable_2} I'm Pytutorial I'm {age} years old"

#print
print(insert_var)