coursera: Use `with` statement for writing a short file.

This way, we hope to be safer with respect to exceptions and doing it "The
Python Way" (TM).

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
coursera: Use fewer statements per line.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
coursera: Improve help message for the new option.

As suggested by me and agreed by John, we use "for".

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>