Relative Content

Tag Archive for pythonpython-3.xsyntax-errorpython-3.5

Why am I getting “invalid syntax” from an f-string? [duplicate]

This question already has answers here: f-strings giving SyntaxError? (6 answers) Closed last year. I cannot get f-strings to work in Python 3. I tried this at the REPL: In [1]: state = “Washington” In [2]: state Out[2]: ‘Washington’ In [3]: my_message = f”I live in {state}” File “<ipython-input-3-d004dd9e0255>”, line 1 my_message = f”I live […]