Search code examples
pythonfloating-pointfloating

TypeError: 'float' object not callable


Why does the following generate the TypeError: 'float' object not callable?

sum([-450.0,950.0])


Solution

  • It looks like you happen to assign to a variable named sum in the same scope as the call above, thereby hiding the builtin sum function.