You do not need to explicitly end the for loop.  The way I think of it is this: if you remove all the non-python code in the file, you will have a file that behaves exactly like a python script file, including in the interpretation of its indentation level.  Does that make sense?