title: How to use nested while loops
body: <p>I'm trying to make a function that uses a nested while loop that prints something like this. </p>
  
  <pre><code>ranges(5,2)
  
  5
  0 1 2 3 4
  4
  0 1 2 3
  3
  0 1 2
  2
  0 1
  </code></pre>
  
  <p>my code that i have so far looks like this</p>
  
  <pre><code>def ranges(high,low):
  while high &gt;= low:
      print(high)
      high = high - 1
      y = 0
      x = high
      while x &gt; y:
          print (y, end = " ")
          y = y + 1
  </code></pre>
  
  <p>The output is like this</p>
  
  <pre><code>5
  0 1 2 3 4
  0 1 2 3
  0 1 2
  0
  </code></pre>
  
  <p>I'm pretty sure I missed up in calling the nested while loop because when i split up the code to just print 5,...,2 in a column it works and so does the code for printing the numbers in a row. Any help would be cool</p>