Set number of digits after decimal
<p>I'm trying to set 3 digits after point but it returns me 0.03 instead of 0.030
Here's the code:</p>

<pre><code>import decimal
decimal.getcontext().prec = 3
a = float(input())
qur = []
x = 2
b = a / 100
while x &lt; 12:
    qur.append(b)
    b = (a * x) / 100
    x += 1
print(" ".join([str(i) for i in qur]))
</code></pre>

<p>You are not using <code>decimal</code>s, so setting their precision has no effect. For output with a fixed number of digits, use string formatting:</p>

<pre><code>print(" ".join('{0:.3f}'.format(i) for i in qur))
</code></pre>

python