SyntaxError: unexpected EOF while parsing
SyntaxError: unexpected EOF while parsing means that the end of your source code was reached before all code blocks were completed. A code block starts with a statement like
for i in range(100): and requires at least one line afterwards that contains code that should be in it.
It seems like you were executing your program line by line in the ipython console. This works for single statements like
a = 3 but not for code blocks like for loops. See the following example:
In : i ( ): File , line i ( ): ^ SyntaxError: unexpected EOF parsing
To avoid this error, you have to enter the whole code block as a single input: