I am fairly new to python and was looking for solutions to generate random MAC addresses when I found this:
':'.join('%02x'%random.randint(0,255) for x in range(6))
what I am trying to understand is the use of '%02x'%
in the code. Is it related to how mac addresses are represented which is a 48 bit hexadecimal value separated by :
?
Aucun commentaire:
Enregistrer un commentaire