I have this code:
inp = int(input("Enter a number:"))
for i in inp:
n = n + i;
print (n)
but it throws an error: 'int' object is not iterable
I wanted to find out the total by adding each digit, for eg, 110. 1 + 1 + 0 = 2. How do I do that?