title: Python 2D list to add the values of a column
body: <p>So I have to use the function def sumColumn(matrix, columnIndex) to add the values of the columns created by the rows entered by the user, and I can't quite figure out what to do from this point.</p>
  
  <pre><code>def sumColumn(matrix, columnIndex):
      return
  
  def getMatrix():
      matrix = []
      for row in range(3):
          print("Enter a 3-by-4 matrix row for row:%d" %row)
          row = input().split(' ')
          row = [float(i) for i in row]
          matrix.append(row)
      return matrix
  
  def display(m):
      for row in m:
          print(row)
  
  def main():
      m = getMatrix()
      print("\nThe matrix is")
      display(m)
      print()
      for col in range(len(m[0])):
          print("Sum of elements for column %d is %.2f" % (col, sumColumn(m,col)))
  
  main()
  </code></pre>