Search code examples
pythonvisual-studio-codevscode-code-runner

F-string error in python when running on vs code


I need help in solving this problem. The screenshot below is of the code line which is giving error. It involves f-string and I am using python 3.7.6 base:conda.

enter image description here


This is the error message that I am getting.

enter image description here


This is the interpreter I am using.

enter image description here

Please help me solve it. Thank you.


Solution

  • So this issue was based on a VS Code extension that I was using to run my code. It was 'Code Runner'.

    Two things need to be done:

    1. Change this in setting.json
    code-runner.executorMap": {"python":"$pythonPath $fullFileName"}
    
    1. Check "run in terminal" in settings for 'code-runner'.