I need to add a '$' to my output of denominations used
<p><a href="http://ideone.com/QxPDFh" rel="nofollow">http://ideone.com/QxPDFh</a></p>

<p>This is my program that I am working on but I need the <code>amount_denom</code> to display the $ with the number. How would I get this done? I need to fix the print statement but how? I am new to coding so sometimes I can't see the obvious stuff. Thank you. </p>

<pre><code>def main():

    denominations = [20, 10, 5, 1, .25, .10, .05, .01]
    used_denom = []
    amount_denom = []

    user_input = float(input('enter a dollar amount: '))

#Keep asking user to re-enter input until they enter a value (0-200)
    while user_input &lt; 0 or user_input &gt; 200:
        user_input = float(input('re-enter a dollar amount: '))

#Traverse the list to breakdown the user_input into denominations. 
    remainder = user_input
    for d in denominations:
        num_denom = int(remainder / d)

        if num_denom &gt; 0:

            used_denom.append(d)

            amount_denom.append(num_denom)

#Avoid dividing by a float (prevents .01 issue from occurring)
        remainder = (remainder*100) % (d * 100) / 100

#Traverse the amount_denom list and print the output to be formatted a certain way. 
    for i in range(len(amount_denom)):

        print("{0: 2d}{1:8.2f}".format(amount_denom[i],used_denom[i]),end = "")
        print("s" if amount_denom[i] &gt; 1 else "")


main() 

print("{0: 2d}  ${1:8.2f}".format(amount_denom[i],used_denom[i]),end="")
</code></pre>

<p>this just shows me:
<a href="https://gyazo.com/ff41f5c82567c71cca05340f23a51e98" rel="nofollow">https://gyazo.com/ff41f5c82567c71cca05340f23a51e98</a></p>

<p>Found out that I just need to change the 8.2f to 5.2f to join the $ and the used_denom to the format I like. Thanks. </p>

<p>Can you add a <code>$</code> to your <code>print</code> statement?</p>

<pre><code>print("${0: 2d}{1:8.2f}".format(amount_denom[i],used_denom[i]),end = "")
</code></pre>

<p>or:</p>

<pre><code>print("{0: 2d} ${1:8.2f}".format(amount_denom[i],used_denom[i]),end = "")
</code></pre>

<p>You can place the <code>$</code> wherever you wish within the string.  You can also add any other characters (e.g. <code>_</code> or <code>-</code>) within the string.</p>

<p>to remove white spaces around the variables, use <code>strip()</code>:</p>

<pre><code>print("{0: 2d} ${1:8.2f}".format(amount_denom[i].strip(),used_denom[i].strip()),end = "")
</code></pre>

<p>if <code>amount_denom</code> and <code>used_denom</code> are not strings, first convert using <code>str()</code>:</p>

<pre><code>print("{0: 2d} ${1:8.2f}".format(str(amount_denom[i]).strip(),str(used_denom[i]).strip()),end = "")
</code></pre>

python