python字符串占位符替换

EPIHPANY / 2024-10-15 / 原文

name = "jack"
print(f"i'm {name}")
print(F"i'm {name}")

print("{1} and {0}".format("eggs", "spam"))

print("this {food} is {adjective}".format(food="spam", adjective="absolutely horrible"))