title: Why does the 'int' object is not callable error occur when using the sum() function?
body: <p>I'm trying to figure out why I'm getting an error when using the sum function on a range.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>data1 = range(0, 1000, 3)
  data2 = range(0, 1000, 5)
  data3 = list(set(data1 + data2)) # makes new list without duplicates
  total = sum(data3) # calculate sum of data3 list's elements
  print total
  </code></pre>
  
  <p>And here is the error:</p>
  
  <pre><code>line 8, in &lt;module&gt; total2 = sum(data3)
  TypeError: 'int' object is not callable
  </code></pre>
  
  <p>I found this explanation for the error:</p>
  
  <blockquote>
    <p>In Python a "callable" is usually a function. The message means you are treating a number (an >"int") as if it were a function (a "callable"), so Python doesn't know what to do, so it >stops.</p>
  </blockquote>
  
  <p>I've also read that sum() is capable of being used on lists, so I'm wondering what is going wrong here?</p>
  
  <p>I just tried it in an IDLE module and it worked fine.  However, it doesn't work in the python interpreter. Any ideas on how that can be?</p>