Hollow Diamond in python
<p>My goal is to create a hollow diamond using python.</p>

<p>Sample input:</p>

<pre><code>Input an odd Integer:
      9
</code></pre>

<p>Sample output:</p>

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

<p>But so far, I have the following code that is not working right. Please help me to modify the code to achieve the goal above:</p>

<pre><code>a=int(input("Input an odd integer: "))

k=1
c=1

r=a

while k&lt;=r:
    while c&lt;=r:
        print "*"
        c+=1

    r-=1
    c=1

    while c&lt;=2*k-1:
        print "*"
        c+=1

    print "\n"
    k+=1

r=1
k=1
c=1

while k&lt;=a-1:
   while c&lt;=r:
       print " "
       c+=1

   r+=1
   c=1

   while c&lt;= 2*(a-k)-1:
       print ("*")
       c+=1

   print "\n"
   k+=1
</code></pre>

<p>The code above return a result that is very far from my goal.</p>

<pre><code>Input an odd integer: 7
*
*
*
*
*
*
*
*


*
*
*
*
*
*
*
*


*
*
*
*
*
*
*


*
*
*
*
*
*
*



*
*
*
*
*
*
*
*
*
*
*


*
*
*
*
*
*
*
*
*


*
*
*
*
*
* 
*


*
*
*
*
*


*
*
*





*
</code></pre>

<p>I am actually converting the code from this post: <a href="http://www.programmingsimplified.com/c/source-code/c-program-print-diamond-pattern" rel="nofollow">http://www.programmingsimplified.com/c/source-code/c-program-print-diamond-pattern</a>  written in C language and will modify later for the hollow one but I can't get it... There is something wrong with my conversion..</p>
