Python error 'str' object has no attribute 'choice'
<p>So, I have this code:</p>

<pre><code>import random, string, os, time
a = 0
random = ''
def calcular():
    global random
    random = ''.join([random.choice(string.ascii_letters) for n in xrange(4)])
    print random
while a&lt;1:
    calcular()
    a=a+1
    pass
print time.strftime('%H:%M:%S')
os.system('pause')
</code></pre>

<p>But I'm getting an </p>

<pre><code>AttributeError: 'str' object has no attribute 'choice'
</code></pre>

<p>What's the problem?</p>