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>Assuming you want it to print out 6 patterns of 6 stars with a line between, this is what you want to do:</p>

<pre><code>import sys

n = 0
a = 0

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

python