title: Code I have written for a happy number checker is not working, could someone check it over?
body: <pre><code>a = int(raw_input("Enter a number to check if it is happy:"))
  l = map(int, str(a))
  c = 0
  while 1:
      for i in l:
         b = i
         c = c + b **2
      if c == 1:
          print "Happy Number!"
          raw_input("Hit enter to end")
          break
      elif c == a:
          print ("Not a Happy number")
          raw_input("Hit enter to end")
          break
      else:
          l = map(int, str(c))
  </code></pre>
  
  <p>This is the code I have written in Python, it works with the numbers 1 and 0, however any other number I have tried leaves it looping infinitely. Could somebody take a look and see what I have done wrong and suggest a solution? Thanks :)</p>
  
  <p>For reference: <a href="http://en.wikipedia.org/wiki/Happy_number" rel="nofollow">http://en.wikipedia.org/wiki/Happy_number</a></p>