Incorrect pattern displayed
<p>In the second while loop the asterisk(*) is displayed just once for every cycle. </p>

<pre><code>import sys

n = 0
a = 0

while (n &lt; 6):
    n = n + 1
    while(a &lt; n):
        sys.stdout.write('*')
        a = a +1
    print ''
</code></pre>

<p>Pattern displayed is :</p>

<pre><code>*
*
*
*
*
*
</code></pre>

<p>Here's a possible solution for your version:</p>

<pre><code>import sys

n = 0
a = 0

while (n &lt; 6):
    n = n + 1
    a = 0
    while(a &lt; n):
        print('*', end="")
        a = a + 1
    print('')
</code></pre>

<p>If you want a shorter version, here's a possible one:</p>

<pre><code>print('\n'.join(['*'*i for i in range(1,7)]))
</code></pre>

python