Boredless Tourist - Invalid Syntax

Hi everyone,

I’m having some difficulty with the Boredless Tourist exercise in the Python course (https://www.codecademy.com/paths/computer-science/tracks/cspath-cumulative-tourism/modules/cspath-boredless-tourist/projects/the-boredless-tourist)

When I try to create my destinations list I get a SyntaxError

$ python3 script.py
  File "script.py", line 2
    destinations = [“Paris, France
                         ^
SyntaxError: invalid character in

My code for that list is just copied and pasted from the directions and I’ve added commas to separate the items in the list.

destinations = [“Paris, France”,
“Shanghai, China”,
“Los Angeles, USA”,
“São Paulo, Brazil”,
“Cairo, Egypt”]

Any help that you can provide would be greatly appreciated

1 Like

Did you directly copy/paste this code? It’s common for the " marks to cause issues.

Yes I copied and pasted from the instructions.

What I meant is that your quotation marks are probably a different character to what the interpreter expected. Try replacing them with a " the straightforward quoation mark rather than the left/right versions you have at the minute. Most keyboards kick out the standard version so far as I am aware.

1 Like

How can I make sure that they are the correct quote styles?

It’s a bit of a hassle but I’d just use the keyboard input to replace them all. Find/replace might be quicker if there’s a lot of them, your browser might have it in-built or you could just copy out to a text editor, replace them all and then paste into the browser. Whatever you find easiest.

They should appear as the vertical ( " ) as opposed to ( “ ) ( ” ) or similar marks with a tilt.

I think this worked!

Thanks.

1 Like