title: Python - TypeError: 'int' object is not iterable
body: <p>Here's my code:</p>
  <pre><code>import math
  
  print(&quot;Hey, lets solve Task 4 :)&quot;)
  
  number1 = input(&quot;How many digits do you want to look at? &quot;)
  number2 = input(&quot;What would you like the digits to add up to? &quot;)
  
  if number1 == 1:
      cow = range(0,10)
  elif number1 == 2:
      cow = range(10,100)
  elif number1 == 3:
      cow = range(100,1000)
  elif number1 == 4:
      cow = range(1000,10000)
  elif number1 == 5:
      cow = range(10000,100000)
  elif number1 == 6:
      cow = range(100000,1000000)
  elif number1 == 7:
      cow = range(1000000,10000000)
  elif number1 == 8:
      cow = range(10000000,100000000)
  elif number1 == 9:
      cow = range(100000000,1000000000)
  elif number1 == 10:
      cow = range(1000000000,10000000000)
  
  number3 = cow[-1] + 1
  
  n = 0
  while n &lt; number3:
      number4 = list(cow[n])
      n += 1
  </code></pre>
  <p>I am looking to make a loop so that for each element in the list, it will get broken down into each of it's characters. For example, say the number <code>137</code> was in the list then it would be turned into <code>[1,3,7]</code>. Then I want to add these numbers together (I haven't started that bit yet but I have some idea of how to do it).</p>
  <p>However, I keep getting this error message:</p>
  <pre><code>TypeError: 'int' object is not iterable
  </code></pre>
  <p>What am I doing wrong?</p>