

This can result in: def mac_conv(mac, sep='-'):

Other than the above function, you don't need to use f.readlines() you can just use f. I'd then join the last three lines into one.Īs return and '.'.join are easy to understand in a single one-liner.

Using hexadecimal makes it much easier, faster and less error prone to write code compared to binary. This can have many advantages to program developers or when carrying out troubleshooting. Machine code and assembly code are covered in much more detail later on in the course, but they are essentially low-level languages that directly access the memory chips in the computer here we are simply interested in how hexadecimal fits into the picture. Computer memory can be referred to directly using machine code or assembly code.
