Hello,
I have just installed Python and have set both build and syntax to Python. I am learning Python, using Codeacademy to get me started. The following code runs fine at Codecademy’s website, but when I put it into Sublime Text 2, I get a syntax error.
Here’s the code:
[code]board = ]
for item in range(0,5):
board.append(“O”] * 5)
def print_board(board):
for row in board:
print " ".join(row)
print_board(board)[/code]
and here’s what returns in the console:
[quote] File “C:\Users[myusername]-- Computer Learning\Python Learning\PythonTest.py”, line 7
print " ".join(row)
^
SyntaxError: invalid syntax[/quote]
(In case the format gets off, the caret (^) is lined up under the second quotation mark, just before the period (.)
Why would it not work? Do I have to import a library or anything?
Thanks for any help!
PS: I am on Windows 7, 64 bit. I have added the Python path to PATH in Advanced System Settings, and can run Python from cmd.exe.