title: How to display the sum of every row and column in a table in python
body: <p>I am trying to write a python program that creates a 10 by 10 table (array) and automatically populates that table with 100 random integers that range from 1 to 250. The program should then display the sum of every row and column for this table.</p>
  
  <p>My program currently outputs a table with 100 random integers, along with the sum of each row. It fails however to produce the sum of each column.</p>
  
  <pre><code>import random
  
  dash = "-" * 62
  
  print("Random Integer Table:")
  
  print(dash)
  print("{:&lt;10s} {:&gt;45s}".format("RANDOM INTEGERS", "ROW TOTAL"))
  print(dash)
  
  for rows in range(10):
      random_list = [random.randrange(1,251, 1) for rows in range(10)]
      stringList = [str(i) for i in random_list]
      row_total = sum(random_list)
  
      print("{:&lt;3} {:&gt;4} {:&gt;4} {:&gt;4} {:&gt;4} {:&gt;4} {:&gt;4} {:&gt;4} {:&gt;4}".format(stringList[0], stringList[1], stringList[2], stringList[3], stringList[4], stringList[5], stringList[6], stringList[7], stringList[8], stringList[9]), "{:17d}".format(row_total))
  
  print(dash)
  print("COLUMN TOTAL")
  print(dash)
  
  sum(random_list(zip([0])))
  </code></pre>
  
  <p>The program currently outputs the following:</p>
  
  <pre><code>Random Integer Table:
  --------------------------------------------------------------
  RANDOM INTEGERS                                     ROW TOTAL
  --------------------------------------------------------------
  71    29   33   69    6  188  167  158  126               892
  100  114  109   89  237  168   25  201   43              1173
  91    51   62  220   63   10   85   79  104               796
  54   189   69   36  218  130  204   76   93              1289
  113   36  104   81   18  215   53  169  103               925
  92    20  206   16  116   69  237  168  212              1253
  116   86  115   62  189  234  158  240  207              1602
  35   101  234   25   41  136   73  154  197              1102
  97    81   13   86   26  140  220   42  180              1132
  118  117  134  170  237  212   89  140  124              1529
  --------------------------------------------------------------
  COLUMN TOTAL
  --------------------------------------------------------------
  </code></pre>
  
  <p>However an error:</p>
  
  <pre><code>TypeError: 'list' object is not callable
  </code></pre>
  
  <p>is present in line 30 (the last line) of my code, when attempting to print the totals for each column. Any way I can properly sum these columns and/or increase efficiency of my program? Thanks.</p>