title: What do the numbers mean in the function range(len(sequence)-1,0,-1) mean?
body: <p>I am currently being tasked with writing the bubble sort algorithm in python and one of the solutions I have come across contains this piece of code.</p>
  
  <pre><code>for passnum in range(len(alist)-1,0,-1):
      for i in range(passnum):
          if alist[i]&gt;alist[i+1]:
              temp = alist[i]
              alist[i] = alist[i+1]
              alist[i+1] = temp
  </code></pre>
  
  <p>In line 1 the range is specified with -1,0,-1 and I don't know why or what this does and was wondering if anyone could help out? Thanks.</p>