0

I apologize for possible upcoming poor English.

So I'm totally beginner at coding though I have basic notions of coding logic, so, as I could successfully run some short begginer projects before, I decided to try the very beginning of a game code shown and explained in a video, Tetris in the case, and since it is complex for whom is beginning I intended to just do the first cells, but for my surprise not even they could run successfully!! I literally just wrote what was in the video but still it failed while in the video the programmer typed while recording, and there it worked.

The codes:

import turtle

wn = turtle.Screen()
wn.title("Test")
wn.bgcolor("black")
wn.setup(width=600, height=800)

grid = [
    [0, 0, 0, 0],
    [0, 0, 0, 0],
    [0, 0, 0, 0],
    [0, 0, 0, 0]
]

wn.mainloop()

Only things I changed are the title and the quantity of rows. Anyway the error is in the "grid = [" cell, and the message is:

"File "C:\Users\I\AppData\Local\Temp/ipykernel_6512/2841163949.py", line 1
    grid = [
            ^
SyntaxError: unexpected EOF while parsing"

I want to go to easier projects later but I'd like to know at least what could be the cause for this, could it be settings or softwares differences?? Or it is really in the codes?

Help would be appreciated, thank you.

Edited the error message, now pasted it full

Codecode
  • 1
  • 2
  • 1
    Welcome to Stack Overflow. Please include the full traceback error. – ewokx May 03 '22 at 04:20
  • The code worked in my environment and returned no errors. Can you execute the script again and provide the entire error traceback? – Chowlett2 May 03 '22 at 04:26
  • Thanks, I added the whole error message now (by the way I use the Jupyter software, in case it makes a difference) – Codecode May 06 '22 at 01:39

0 Answers0