title: Python pattern right triangle with while loop in python
body: <p>I need to print the numbers in a specific shape and order with a while loop, <strong>for loop is not allowed</strong>, but I don't understand nor can I find anything on the web that can help me understand how can I move the figure a bit to the right or how I can flip it around. Here is the code I have at the moment. I wanted to use a delta, which is 8 spaces multiplied with the digits behind to move the shape to the right and convert everything behind the top shape into empty spaces but don't know how to do it</p>
  <pre><code>    i = 1
  delta = 8
  while i &lt;= 5:
      j = 1
      while j &lt;= i:
          print(j, end=&quot;&quot;)
          j += 1
      print()
      i += 1
  a = 5
  while a &gt;= 1:
      b = 1
      while b &lt;= a:
          print(b, end=&quot;&quot;)
          b += 1
      print()
      a -= 1
  </code></pre>
  <p><a href="https://i.stack.imgur.com/aTbz7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aTbz7.png" alt="enter image description here" /></a></p>
  <p>and here is the result I get,I need to move the first loop to the right so I can get this shape <a href="https://i.stack.imgur.com/Y8hhx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y8hhx.png" alt="enter image description here" /></a></p>
  <p>After that I need to make the lower loop inverted and to use the number 1 from the top loop to make it seem like it fits with the lower loop one, I was able to do it with a for loop but i am not sure how I can do it with a while loop and maintain the shape.</p>