Printing Simple Diamond Pattern in Python
<p>I would like to print the following pattern in Python 3.5 (I'm new to coding): </p>

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

<p>But I only know how to print the following using the code below, but not sure how to invert it to make it a complete diamond:</p>

<pre><code>n = 5

print("Pattern 1")

for a1 in range (0,n):
    for a2 in range (a1):
        print("*", end="")
    print()

for a1 in range (n,0,-1):
    for a2 in range (a1):
        print("*", end="")
    print()

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

<p>Any help would be appreciated!</p>

<p>As pointed out by Martin Evans in his post: <a href="http://stackoverflow.com/a/32613884/4779556">http://stackoverflow.com/a/32613884/4779556</a> a possible solution to the diamond pattern could be: </p>

<blockquote>
<pre><code>side = int(input("Please input side length of diamond: "))

for x in list(range(side)) + list(reversed(range(side-1))):
    print('{: &lt;{w1}}{:*&lt;{w2}}'.format('', '', w1=side-x-1, w2=x*2+1))
</code></pre>
</blockquote>

python