Python - Adding characters to string : <p>I am trying to make a password generator. I've tried using a for loop to generate each digit. I then appended each digit to a list. However, I want the output to be something along the lines of: </p>

<pre><code>54324
</code></pre>

<p>rather than:</p>

<pre><code>[5, 4, 3, 2, 4]
</code></pre>

<p>The following is my code:</p>

<pre><code>    code = ''
    chars = 5
    for i in range(chars):
        digit = str(randint(0,9))
        digit += code
</code></pre>

<p>What happens in this scenario is that my output is just blank. I am somewhat new to python, so I may be missing something obvious, but I would appreciate if you could explain what I've done wrong and how to fix it.</p>
