Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F string prefix in python giving a syntax error [duplicate]

Tags:

python

string

I have a variable called method, it's value is POST but when I try to run print(f"{method} method is used.") it keeps giving a syntax error at the last double quote and I can't find the reason on why it does this. I am using python 3.5.2.

like image 215
PlanetTeamSpeak Avatar asked Jan 31 '26 10:01

PlanetTeamSpeak


1 Answers

F-strings were a new feature introduced in Python 3.6, so of course they're not going to work in 3.5.2.

like image 120
jasonharper Avatar answered Feb 02 '26 22:02

jasonharper