python3 12 digits script each digit equal three time beore him?
<p>Write a program that displays <strong>12 digits</strong>,</p>

<p>each digit is equal to three times the digit before him.</p>

<p>I tried to code like this </p>

<pre><code>a , b , c = 1 , 1 , 1

print(c)

while c &lt; 12 :       # for looping

    c = c + 1        # c for counting

    b = a+b

    y = 3*b

    print(c,y)
</code></pre>

<p>can any one help me to correct the result </p>

<p>You can start with a list where first element is the beginning of the multiples:</p>

<p>-- start with 1 or the number you like</p>

<pre><code>multiples = [1]
for i in range(1, 12):
    multiples.append(3 * multiples[i - 1])

print(multiples)
</code></pre>

<p>-- Output : [1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, 177147]</p>

python python-3.x