inp = int(input(\"Enter a number:\")) for i in inp: n = n + i; print (n)
... throws an error: \'int\' object is not iterable<
\'int\' object is not iterable
Side note: if you want to get the sum of all digits, you can simply do
print sum(int(digit) for digit in raw_input('Enter a number:'))