title: While loop over range(0,5) with ran = ran[:-1]; ran != [] is always true
body: <p>I have a very simple code in Python and can't figure out why the loop won't stop. I specifically wanted to use a helper function inside the function. Any ideas?</p>
  
  <pre><code>def x():
      a = range(0,5)
  
      def y(ran):
          while ran != []:
              ran = ran[:-1]
              print(ran)
              return y(ran)
  
      return y(a)
  
  x()
  </code></pre>