title: Nested loops: representing factors of numbers up to 20 graphically
body: <p>I want to write a program in python that represents the factors of numbers graphically. I don't know how to explain exactly what I mean with words, so I will describe the output I am looking for:</p>
  
  <pre><code>* - - - - - - - - - - - - - - - - - - -
  * * - - - - - - - - - - - - - - - - - -
  * - * - - - - - - - - - - - - - - - - -
  * * - * - - - - - - - - - - - - - - - -
  * - - - * - - - - - - - - - - - - - - -
  * * * - - * - - - - - - - - - - - - - -
  * - - - - - * - - - - - - - - - - - - -
  * * - * - - - * - - - - - - - - - - - -
  * - * - - - - - * - - - - - - - - - - -
  * * - - * - - - - * - - - - - - - - - -
  * - - - - - - - - - * - - - - - - - - -
  * * * * - * - - - - - * - - - - - - - -
  * - - - - - - - - - - - * - - - - - - -
  * * - - - - * - - - - - - * - - - - - -
  * - * - * - - - - - - - - - * - - - - -
  * * - * - - - * - - - - - - - * - - - -
  * - - - - - - - - - - - - - - - * - - -
  * * * - - * - - * - - - - - - - - * - -
  * - - - - - - - - - - - - - - - - - * -
  * * - * * - - - - * - - - - - - - - - *
  </code></pre>
  
  <p>I wrote this program:</p>
  
  <pre><code>for i in range (1,21):
      for j in range (1,21):
          if i%j == 0:
              print '*',
          else:
              print '_',
  </code></pre>
  
  <p>But the output is on a single line and I don't know how to fix that. I played around with the commas but I still don't get what I want.</p>
  
  <p>By the way, almost all of my questions are about problems with formatting the output. How can I improve at doing that? There is no chapter in a book or tutorial dedicated to formatting the output so I don't know how to improve.</p>