title: Print csv input file into a table of columns/rows
body: <p>I am trying to write a program that (among other things), prints an input file ('table1.txt') into the format seen below. </p>
  
  <p><a href="https://i.stack.imgur.com/DzZ5e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DzZ5e.png" alt="enter image description here"></a></p>
  
  <p>Where diff is the difference between the 3rd and 4th value of each line.</p>
  
  <p>I think I have the basic idea figured out and I tried doing:</p>
  
  <pre><code>f = open("table1.txt",'r')
  
  for aline in f:
      values = aline.split(',')
      print('Team:',values[0],', Points:',values[1],', Diff:',values[2]-values[3],'Goals:',values[2]) 
  
  f.close()
  </code></pre>
  
  <p>But it results in a operand type error. I think I just have to change the way I iterate over the items in the file but I do not know how.</p>