🔢Hexadecimal
Also known as Hex, Base 16, Base-16
A way of writing numbers with sixteen digits, 0 to 9 and A to F.
Think of it like
Think of it like a short way to write a long row of switches. One letter stands for four of them.
Example
Jack sets a button colour to #FF0000. FF is 255 in hex, so the red part is turned all the way up.
Why it matters
Hex shows up in colours, file data and error codes. Reading it saves a lot of guessing.
Definition
Example code
python
>>> hex(255)
'0xff'
>>> int('ff', 16)
255Common mistake
Key takeaways
- 1Sixteen digits. 0 to 9, then A to F.
- 2Four bits each. A short way to write binary.
- 3Seen in colours. Like #FF0000 for red.