A computer has never once seen a letter. It sees numbers, and it has been told what they mean.
You skimmed this in 0.2 for the byte. This time read it for the table. Enrolled in our Runestone course? Open it from there so your progress counts.
Still in Bits. You can now turn numbers into bits and back (1.2), and you know what happens when a number outgrows its bits (1.3). Everything so far has been about numbers. Starting now, we use numbers to represent things that aren't numbers — and text is the first one.
Decode it. Then notice what just happened: nothing about those numbers is text. They became text because you applied an agreement. Your computer does exactly the same thing, millions of times a second, and it is no more "reading" than you were.
A wire carries bits. Bits make numbers. So to send a letter, somebody had to sit down and decide which number is the letter A — and then get everyone else to agree. That agreement is called a character encoding, and the one that won is ASCII, standardized in 1963.
128 slots is enough for the uppercase letters, the lowercase letters, the ten digits, punctuation, and a set of control codes like "newline." Here are the four numbers worth memorizing, because they anchor the whole table:
| Character | Decimal | Binary (8-bit) | Why it matters |
|---|---|---|---|
| space | 32 | 00100000 | A space is a character. It costs a byte like anything else. |
| '0' | 48 | 00110000 | The character zero, not the number zero. |
| 'A' | 65 | 01000001 | Uppercase starts here and runs to 'Z' = 90. |
| 'a' | 97 | 01100001 | Lowercase starts here and runs to 'z' = 122. |
Look hard at the last two rows. 97 − 65 = 32, and 32 is a power of 2 — which means uppercase and lowercase differ by exactly one bit:
A 01000001 = 65 a 01100001 = 97 โ this bit, worth 32, is the entire difference
That was not luck. The people who designed ASCII arranged the table so that changing case is a single bit flip, which made it fast and cheap on 1963 hardware. You'll flip that bit yourself in a minute.
'7' is not the number 7.
'7' is ASCII 55. If a program adds '7' + '7' as text it gets
'77'; if it adds them as numbers it gets 14. Nearly every "why is my program
doing that" moment in Unit 2 traces back to this distinction.
ASCII was designed by an American committee for American English. It has no é, no ñ, no ü. No Greek, no Cyrillic, no Arabic, no Hebrew, no Devanagari. No Chinese — and Chinese alone needs thousands of characters, which will not fit in 128 slots no matter how the slots are arranged.
Stretching to 8 bits bought 256 slots. Still nowhere near enough. What actually solved it was Unicode, begun in 1991, which gave every character in every writing system its own number — currently well over 150,000 of them, in a space with room for more than a million. Emoji live there too, which is why ๐ is not a picture your phone stores but a number your phone looks up and draws.
Unicode's common storage format, UTF-8, is deliberately backwards-compatible: any plain ASCII character still takes exactly one byte and still has exactly its old ASCII number. Characters outside ASCII take two, three, or four bytes. That is why an emoji costs four times what a letter costs, and you can watch that happen in the encoder below.
Here is the lookup table the hook promised. Decode the hook first, on paper, before you touch the widget.
Write your first and last initial. Look up each one in the table above. Convert both numbers to 8-bit binary using the method from 1.2 — subtract the largest power of 2 that fits, and pad with leading zeros until you have eight digits.
Now trade with a partner and decode theirs. Then answer this without checking: if your initials were lowercase instead, which single bit would change in each byte?
Now let the machine do it. Type anything — your name, the hook sentence, an emoji.
The one-bit case flip. Type a single letter and watch which bit does the work.
In Unit 2 you stop doing this by hand. Python has two functions that are this lookup table:
print(ord('A')) โ 65 # character โ number print(chr(97)) โ 'a' # number โ character print(ord('a') - ord('A')) โ 32 # the case gap, confirmed
You just used all three of these. Now they get names.
Five questions in AP format. Pick an answer to see feedback immediately.
ASCII was not neutral. It was designed in the United States, in 1963, for English, and its 128 slots have room for every letter an English speaker needs and not one character more. That was a reasonable engineering decision under real hardware limits — and it became the default for computing worldwide.
The consequence lasted decades. If your language used accents, a different alphabet, or thousands of characters, you either worked in English or you used one of many incompatible regional workarounds, where the same byte meant a different character depending on which country's system opened the file. Text that looked fine when you sent it arrived as garbage.
Unicode largely fixed the standard. It did not fix every system built on the old assumption, which is why people whose names contain characters outside ASCII still find them silently stripped, replaced with question marks, or rejected by forms — on boarding passes, medical records, and government paperwork. A limit chosen for good reasons in 1963 is still, occasionally, deciding whose name is spelled correctly.
ord() and chr() let Python
do this lookup for you, and '7' vs 7 becomes a bug you have to
actually fix.