In the CodeHS curriculum (typically for AP Computer Science Principles or introductory Python), 8.3.8 “Create Your Own Encoding” is a milestone exercise. It asks students to move from being users of encoding (like ASCII or Unicode) to being designers.
| Mistake | Why It Happens | Fix |
|---------|----------------|-----|
| Forgetting to handle spaces | Space (' ') has ASCII 32. After shift, it becomes 37, which is '%'. Your decode must reverse correctly. | Test with "a b" to ensure spaces survive round-trip. |
| Using a non-reversible rule | Example: multiplying by 2. Two different chars (like 'a'=97 and 'b'=98) could map to same number after mod. | Always use a bijective (one-to-one) rule. Addition/subtraction works perfectly. |
| Returning a string instead of list | The prompt explicitly asks for a list of integers. | Use encoded_list.append(...) and return the list. | 8.3 8 create your own encoding codehs answers
Using the sequential 5-bit mapping, convert each letter of "HELLO WORLD" into its binary equivalent: Resulting String 0011100100010110101101110110101011001110100010101100011 Verification CodeHS autograder typically checks for: Use of 5 bits (the minimum). Presence of 'A', 'Z', and 'Space'. Consistent mapping for all characters in the set. ✅ Final Answer To complete the assignment, use a 5-bit encoding scheme , and so on, with assigned a unique value like Python script template Report: Decoding CodeHS 8
For 8.3.8, you are building an encoder/decoder pair. It’s a great exercise in using dictionaries, loops, and string manipulation. It asks students to move from being users
If you want this tailored to a specific allowed character set or language (e.g., include lowercase, digits, or emojis), tell me which and I’ll adapt the scheme and examples.