How could I clean up this pattern drawing code?
<p>so I am trying to draw  a simple pattern, kind of two parted. The way it is supposed to look is:</p>

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

<p>As of now, I have the bottom part finished but it isn't very clean at all, it is very bulky and there has to be a way to smooth it out, and make it quicker and more concise, for the top part, I still need to figure out how to add in the *'s moving across, I had a few ideas but they all failed haha.</p>

<p>So what I have as of now is:</p>

<pre><code>    x = 8
while x &gt; 4:
    for  c in range(0,1):
         print('*', end='')
         for r in range(0,10):
             print('.', end='')
         print('*')
         x = x-1
</code></pre>

<p>This is the top part as of now, it works to get the * on either side of the periods, my bottom part however is really messy and I just think there has to be a way to make it quicker:</p>

<pre><code>while x == 4:
    for c in range(0,9):
        print('.', end='')
    print('*')
    x = x-1
    while x == 3:
        for c in range(0,8):
            print('.', end='')
        print('*')
        x = x-1
        while x == 2:
</code></pre>

<p>it keeps going like that until 
        while x == 1:
and that is that, but is there a way to compress that code into something quicker, and how exactly do I go about adding in the *s going side to side on the top 4 rows? I'm not asking for answers per say, other than the bottom side - just a point in the right direction, I prefer to learn rather than just be given the answer.</p>

<pre><code>'.'*6 
</code></pre>

<p>means 
<code>......</code> (dot six times) so instead of </p>

<pre><code>for c in range(0,9):
    print('.', end='')
</code></pre>

<p>just do</p>

<pre><code>print('.'*9,end='')
</code></pre>

python loops while-loop range