Mathematical operators in python code
<p>Can some one explain this statement. I think this code is written in C and I am trying to convert it in python. Please bare with me as I am new to python and programming.</p>

<pre><code>class hello(object):

      def abc(self):
           d =[0] * 2048
           d = [2048/8] |= 0x01 &lt;&lt; 2048%8 # how type this in python
            return d
</code></pre>

<p>Thank  you
         See comments</p>

<pre><code>k = 2
m = 256*8
 //the filter
  byte[m/8] bloom   
  function insertIP(byte[] ip) {
byte[20] hash = sha1(ip)
int index1 = hash[0] | hash[1] &lt;&lt; 8
int index2 = hash[2] | hash[3] &lt;&lt; 8
// truncate index to m (11 bits required)
index1 %= m  
index2 %= m  

// set bits at index1 and index2
bloom[index1 / 8] |= 0x01 &lt;&lt; index1 % 8   ## how this would be written in python
bloom[index2 / 8] |= 0x01 &lt;&lt; index2 % 8   ## ??
 }

// insert IP 192.168.1.1 into the filter:
 insertIP(byte[4] {192,168,1,1})
</code></pre>
