python字符串占位符替换

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"))
posted @ 2024-10-14 11:04  EPIHPANY  阅读(49)  评论(0)    收藏  举报