Sum of the digits
Contrary to other answers, both your code works fine.
I think you are shadowing something on your code. Perhaps you used int as a variable?
I want to get the sum of the digits of an integer, and found the solutions below:

sum(map(int,list(str(123))))

sum(int(digit) for digit in str(123))


However, when I run this, I get the below error:

TypeError: 'int' object is not callable