title: Not sure why I keep getting this error: TypeError: '_io.TextIOWrapper' object is not callable
body: <p>I've seen a bunch of similar questions to this with great answers but I'm not sure how to apply them to the following code. I am just learning and other than this error I think I am good to go on this assignment so any help would be much appreciated!</p>
  <pre><code>def do_research():
  
      num_month = 1
      num_cages = int(input(&quot;Number of cages: &quot;))
      num_adults = int(input(&quot;Adult pairs in the first month: &quot;))
      num_babies = int(input(&quot;Pairs of babies in the first month: &quot;))
      total = num_adults + num_babies
      output_file = open(&quot;rabbits.csv&quot;, &quot;w&quot;)
      output_file.writelines(&quot;# Table of rabbit pairs\n&quot;)
      output_file.writelines(&quot;Month, Adults, Babies, Total\n&quot;)
      output_file.writelines(str(num_month) + &quot;,  &quot;)
      output_file.writelines(str(num_adults) + &quot;,  &quot;)
      output_file.writelines(str(num_babies) + &quot;,  &quot;)
      output_file.writelines(str(total) + &quot;\n&quot;)
      while (total / 2) &lt; num_cages:
          num_month += 1
          num_babies = num_adults
          num_adults += num_babies
          total = num_adults + num_babies
          output_file.writelines(str(num_month) + &quot;,  &quot;)
          output_file.writelines(str(num_adults) + &quot;,  &quot;)
          output_file.writelines(str(num_babies) + &quot;,  &quot;)
          output_file.writelines(str(total) + &quot;\n&quot;)
      output_file.writelines(&quot;# Cages will run out in month &quot; + str(num_month))
      output_file()
  do_research()
  </code></pre>