🧩Byte
Also known as Bit, Kilobyte, Megabyte, Gigabyte, KB, MB, GB
A group of 8 bits, each a 0 or 1. Computers count size in bytes.
Think of it like
Think of it like a row of eight light switches. Each one is on or off, and the row together means one thing.
Example
Lucy saves the word "Hello" in a plain text file. The file is 5 bytes, one for each letter.
Why it matters
Bytes are how size is measured: files, memory, downloads and storage. Every limit you meet is in bytes.
Definition
Example code
python
print(len("Hello".encode()))
# 5Common mistake
Key takeaways
- 1Eight bits. Each bit is a 0 or a 1.
- 2256 patterns. One byte can mean 256 different things.
- 3The unit of size. Files and memory are counted in bytes.