title: Python Code Error random script
body: <pre><code>import random, string    
  max_str_length = 20
  while True:
      random = ''.join(random.choice(string.lowercase) for _ in range(random.choice(range(1, max_str_length))))
      print random
      if random=="hugh":
          print "Done"
  </code></pre>
  
  <p>What's the error here? It says "Attribute Error: 'str' object has no attribute 'choice'"</p>