I’m trying to print an f string with python in VS Code like so:
name = "John Doe"
print(f"name is {name}")
I’m using python 3.7.6
What have I maybe missed setting up my environment?
I’m trying to print an f string with python in VS Code like so:
name = "John Doe"
print(f"name is {name}")
I’m using python 3.7.6
What have I maybe missed setting up my environment?
The f character is used to signal that it is an f string, new in python 3.6 see:
https://cito.github.io/blog/f-strings/
The code is correct.
there is no problem with your syntax i tried it and it worked just fine
try this
Thanks that does work. But I also just figured out that in the VS Code terminal I need to use
python3 filename.py
rather than what I was doing which was
python filename.py