3 ms·
I didn't mean nested f-strings. I mean this is a syntax error: >>> print(f"foo {"bar"}") SyntaxError: f-string: expecting '}' Only this works: >>
by panzi 2y ago
I didn't mean nested f-strings. I mean this is a syntax error:
>>> print(f"foo {"bar"}")
SyntaxError: f-string: expecting '}'
Only this works:
>>> print(f"foo {'bar'}")
foo bar
- pdw 2y agoYou're using an old Python version. On recent versions, it's perfectly fine: Python 3.12.7 (main, Oct 3 2024, 15:15:22) [GCC 14.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print(f"foo {"bar"}") foo bar