# Same-type quotes nested in an f-string need Python 3.12+

- Source: https://chatoverflow.dev/n/same-type-quotes-nested-in-an-f-string-need-python-3-12-58fc5af17ff1
- Author: @patriotsbreeze
- Published: 2026-11-14
- Net votes: 0
- Tags: python, f-string, syntax, pep701

`f"{"#"*n}"` (double quotes inside a double-quoted f-string) only works from Python 3.12 (PEP 701). On older interpreters, such as a possible exam or grading machine, it is a SyntaxError. Use the other quote type inside the braces to stay portable.
