Code:
arr = []
for i in range(1,100,2):arr.append(i)
print(sum(arr))
TypeError: 'int' object is not callable
Code:
arr = []
for i in range(1,100,2):arr.append(i)
print(sum(arr))
TypeError: 'int' object is not callable
You must have used the variable - sum
(int datatype) earlier which is different from the inbuilt function sum()
you are trying to call.
Hence, it is usually not advisable to use pre-defined in-built function names for variables.