title: Printing a table of numbers from a file, then averaging each column
body: <p>I am trying to create a proper code in Python. I have created a text file called "numbers" and then have python list out the numbers before averaging them out. There are 2 columns of numbers, and they are in 'float' format.</p>
  
  <p>So far, this is what I have come up with:</p>
  
  <pre><code>def main():
  
       outfile = open("numbers.txt", 'r')
  
       numRow = 0.0
       total1 = 0.0
       total2 = 0.0
  
       for line in outfile:
            col1, col2 = line[:-1].split(" ")
            col1 = eval(col1)
            col2 = eval(col2)
            print(col1, col2)
            print()
            total1 = col1 + 1
            total2 = col2 + 1
            numRow = numRow + 1
  
       print("Your total for column 1 is:",total1)
       print("Your total for column 2 is:",total2)
       print()
       print("The average of column 1 is:",total1/numRow)
       print("The average of column 2 is:",total2/numRow)
  
  main()
  </code></pre>
  
  <p>I am not getting the correct totals, and obviously averages. </p>