title: Python - Project Euler #57, understanding the error
body: <p>When I run this code to calculate convergents of the root 2 continued fraction:</p>
  
  <pre><code>def root_two_expansion():
      total=0
      a=(3,2)
      b=(7,5)
      x=3
      while x&lt;=1000:
          c=((sum(a)+sum(b)),sum(b))
          if len(str(c[0]))&gt;len(str(c[1])):
              total+=1
          a=b,b=c
          x+=1
      return total
  
  print root_two_expansion()
  </code></pre>
  
  <p>I receive this error:</p>
  
  <blockquote>
    <p>069.506.py", line 7, in root_two_expansion
        c=((sum(a)+sum(b)),sum(b))
    TypeError: 'int' object is not iterable</p>
  </blockquote>
  
  <p>Why is this? I don't understand at which stage the code tries to iterate over an int. I would be grateful for any suggestions.</p>