title: Generate random characters against specific loop condition
body: <p>I want to continue generating a single character at random as long as the loop condition is not met. I was hoping my code below will work but it doesn't:</p>
  
  <pre><code>import string
  import random
  
  def random_characters(number):
      i = 0
      new_string = ''
  
      while (i &lt; number) :
          new_string = random.choice(string.ascii_lowercase)
          i = i + 1
          return new_string
  
  
  random_characters(3)
  </code></pre>
  
  <p>When i run this code nothing happens and I don't get any feedback about any error. I may be using <code>return new_string</code> in a wrong way but I am unable to figure it out even if that is what I'm missing.</p>