title: Compare two adjacent elements in same list
body: <p>I have already gone through a <a href="https://stackoverflow.com/questions/14012562/how-to-compare-two-adjacent-items-in-the-same-list-python">post</a> but I want to know what I did wrong in my code while using <code>for</code> loop.</p>
  
  <p>List <code>a</code> given as:</p>
  
  <pre><code>a = [2, 4, 7,1,9, 33]
  </code></pre>
  
  <p>All I want to compare two adjacent elements as :</p>
  
  <pre><code>2 4
  4 7
  7 1
  1 9
  9 33
  </code></pre>
  
  <p>I did something like:</p>
  
  <pre><code>for x in a:
      for y in a[1:]:
          print (x,y)
  </code></pre>