title: Nested loop code to create right triangle in Python
body: <p>Professor gave us a simple code that executes a square and we need to add/change the code to output the right triangle shape as shown below. It's just a simple loop within a loop code, but I can't find tips or help anywhere for creating shapes with Python without the code looking extremely confusing/difficult. I need a simple explanation what to do and why I need to make those changes. </p>
  
  <p>(Nested loop code to create right triangle in Python)</p>
  
  <p>The code given that executes a square:</p>
  
  <h1>Draw Square</h1>
  
  <pre><code>size = input('Please enter the size: ')
  chr  = raw_input('Please enter the drawing character: ')
  
  row = 1
  while row &lt;= size:
      # Output a single row
      col = 1
      while col &lt;= size:
          # Output a single character, the comma suppresses the newline output
          print chr, 
          col = col + 1
  
      # Output a newline to end the row
      print '' 
  
      row = row + 1
  print ''
  </code></pre>
  
  <p>The shape I need to output.....</p>
  
  <pre><code>x 
  x x 
  x x x 
  x x x x 
  x x x x x 
  x x x x x x 
  x x x x x x x
  </code></pre>
  
  <p>Once again, just a simple code explanation, it's an introduction to Python course.</p>