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
I have written a code
def mac_to_int(macaddress):
i=0
mac=list(macaddress)
mac_int=0;
for i in range(len(macaddress)):
mac_int=mac_int<<8
mac_int+=mac[i]
return mac_int
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
str.replace()
andint