title: Is there any way to exclude lines from looping inside of a loop?
body: <p>I was writing this code for a password generator in python, but when i execute it, it displays &quot;I generated some random Passwords, Pick the one you like!&quot; each time with each password. Is there a way to exclude this line out of this loop? Please help! here is the code:</p>
  <pre><code>import random
  
  
  chars = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@#$1234567890&quot;
  
  while 1:
      password_len  = int(input(&quot;Please specify the length of password:&quot;))
      password_count =int(input(&quot;How many passwords should i generate?&quot;))
      for x in range(0,password_count):
          password =&quot;&quot;
          
          for x in range(0,password_len):
              password_char = random.choice(chars)
              password     = password + password_char
          print (&quot;I generated some random Passwords, Pick the one you like!&quot;,password)
  </code></pre>
  <p>I want it to look like this:</p>
  <p><strong>Please specify the length of password:</strong>-  <em>4</em>.
  <strong>How many passwords should i generate?</strong>  -  <em>2</em>.
  <strong>I generated some random Passwords, Pick the one you like!
  j7G@
  hjh4</strong></p>