<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_output(self, fout):
 """Squash self.out into string. Join every line in self.out with a new line and write the result to the output file. """

        fout.write('\n'.join([s for s in self.out]))