title: Range() function not working
body: <p>I am trying to write the program that will be given a 2d list with coordinates of points on a grid (ex.<code>[[4, 7], [5, 6], [5, 2]]</code>), and will return all points passed during "walking". We can go diagonal.</p>
  
  <pre><code>def pole(lista):
      passed = []   #List with all points passed
      before = lista[0]  #list with coordinates before
      for i in range(1,len(lista)):
          first = [list(range(before[0],lista[i][0]))]   # Lists that should have all points
          second = [list(range(before[1],lista[i][1]))]  # passed from point to point
  
          if(len(first) == 1):                  #If we do not go diagonal, one list will only have one number here,
              first = [before[0]*len(second)]   # but we need the same number of itmes,
          if(len(second) == 1):                 # so we do not get IndexOutOFRange error in next for   
              second = [before[1]*len(first)]
          #print(first,second)
          for j in range(len(first)):
              passed.append([first[j], second[j]])
          before = lista[i]
      return passed
  </code></pre>
  
  <p>We are using the example list as an input. <code>[[4, 7], [5, 6], [5, 2]]</code></p>
  
  <p>The problem is that the output is wrong and I do not know why:</p>
  
  <pre><code>[[4, 7], [5, 6]]
  </code></pre>
  
  <p>And the output should be:</p>
  
  <pre><code>[[4,7], [5,6], [5,5], [5,4], [5,3], [5,2]]
  </code></pre>
  
  <p>I think it is a problem of range function</p>