W1 A2, invalid syntax error, idk why

Am I doing something wrong here? I don’t get it.

Some things you might want to try:

  1. Re-run the cells/code before this cell. It might be missing the import for tfl
  2. Check the indentation (number of spaces) at the beginning of the line (and the lines around it). It must line up correctly, otherwise it could lead to an invalid syntax error

I have re run the codes from the start, does not work. Tried playing around with the tab spaces in front of the code lines, but it was in vain.

It could also be that the previous line may be missing some brackets or spaces.

Can you send me the code around it through direct message?

FYI - turns out the issue is with missing commas. The layers are items in a python list, and each item in the list should be separated by a comma.

When you get a syntax error at the beginning of a line, it is almost always caused by a syntax error on the previous few lines of code.

Parenthesis, square brackets, and commas are the most common cause.