Sublime Forum

Error syntax

#1

Hello there, I am using macbook pro for sublme text. I always get this error everytime I encode this line

name = ‘pope’
print(f"How are you {name}?")
-the second line is the syntax error-

Need help please.

Thank you
pope

0 Likes

#2

The print statement you’re using is using an f-string; Those are only available in Python 3.6 and up, so if you’re seeing a syntax error there it’s likely because your code is executing in an earlier version of Python, such as Python 2.

If that’s the case, you need to adjust the sublime-build file to execute Python 3 instead of Python 2, which also requires that you have Python 3 available on your computer.

0 Likes

#3

okay thank you very much. I will find a way to update

0 Likes