我正在使用Python 3.7。
我在第三行的代码可以正常工作,但是当我将底层公式插入第四行时,我的代码返回错误:
SyntaxError: f-string: mismatched '(', '{', or '[' (该错误指向第4行中的第一个“(”)。
我的代码如下:
cheapest_plan_point = 3122.54
phrase = format(round(cheapest_plan_point), ",")
print(f"1: {phrase}")
print(f"2: {format(round(cheapest_plan_point), ",")}")
我无法弄清楚第4行有什么问题。
print(f"2: {format(round(cheapest_plan_point), ',')}")
。 - Space Impact