How does the shift "1<<i" work in Python?
<p>I have the following code in Python:</p>

<pre><code>for i in range(4):
  if self.start == self.corners[i]:
    self.visitedCorners += (1 &lt;&lt; i)
</code></pre>

<p>I'm working with co-ordinates. <code>self.start</code> and <code>self.corners</code> are co-ordinates.</p>

<p>So with the code on the top I want to check whether the start is a corner.
If the start is the same of a corner, I do that shift. But, how does that shift work?</p>

<p>I don't want any other code; I just want to understand <em>this</em> code. </p>
