SyntaxError: unexpected EOF while parsing means that the end of your source code was reached before all code blocks were completed.
The code block starts with a statement like for i in range(100): and requires at least one line afterward that contains code that should be in it.
It looks like you were executing the program line by line in the ipython console. This will work for single statements like a = 3 but not for code blocks like for loops.
Have a look at the following example:
In : for i in range(100):
File "<ipython-input-1-ece1e5c2587f>", line 1
for i in range(100):
SyntaxError: unexpected EOF while parsing
And to avoid this error, you should enter the whole code block as a single input like this:
In : for i in range(5):
...: print(i, end=', ')
0, 1, 2, 3, 4,