title: how to convert mac address to decimal in python
body: <p>I want to write a function in python that take mac address as argument and convert that mac address to decimal form.please provide solution supported in python2</p>
  
  <p>I have written a code</p>
  
  <pre><code>def mac_to_int(macaddress): 
     i=0  
     mac=list(macaddress)
     mac_int=0;   
   for i in range(len(macaddress)):
     mac_int=mac_int&lt;&lt;8
     mac_int+=mac[i]
  
  return mac_int
  </code></pre>
  
  <p>actually in 3rd line where i want to copy content of macaddress to mac i just wanted to know that i have written correct way or not</p>