title: storing data into a file rather than returning to the terminal
body: <p>i have this function: <code>write_reversed_file(input_filename, output_filename)</code> that writes to the given output file the contents of the given input file with the lines in reversed order. i just need the output to be written to the file (<code>output_filename</code>) rather than to the terminal (python shell).</p>
  
  <p>the only part im missing is to store the output into the file.
  i successfully managed to complete the reversing lines part.</p>
  
  <pre><code>def write_reversed_file(input_filename, output_filename):
      for line in reversed(list(open(filename))):
          print(line.rstrip())    
  </code></pre>