title: a question on for loops in python
body: <p>I want to calaculate pythagorean triplets(code below) and I want to calculate infinitly how do I do it without using the three for loops? Could I use a for loop in some way? thanks.</p>
  
  <pre><code>import math
  
  def main():
      for x in range (10000, 1000):
          for y in range (10000, 1000):
              for z in range(10000, 1000):
                  if x*x == y*y + z*z:
                      print y, z, x
                      print '-'*50
  
  if __name__ == '__main__':
      main()  
  </code></pre>