why am I getting a syntax error in python 2.7.14 [duplicate]

I’m guessing that you are getting a syntax error related to the print statement if you are using the wrong version of Python. Make sure you are using Python 2.x, otherwise upgrade your code to be compatible with Python 3.x.

python --version should tell you which version you are using

Python 3.x version of your code. Notice the round brackets used with the print statement.

coord  =  {'latitude' : '37.24N' , 'longitude' : '-115.81'} 
print('coordinates:  {latitude},  {longitude}'.format(**coord))

Leave a Comment