| 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 . | Use encoded_list.append(...) and return the list. |
Does your specific CodeHS autograder require ? Share public link
Your custom encoding scheme does not need to match ASCII or any other standard. You have the freedom to decide exactly which binary codes correspond to which characters. This freedom allows you to think like a compression engineer: if you want to maximize efficiency, you can assign shorter binary codes to frequently used characters and longer codes to rarely used ones.
Replacing specific characters with symbols, numbers, or entirely different letters (e.g., replacing all vowels with numbers). Step-by-Step Logic Breakdown 8.3 8 create your own encoding codehs answers
To create an encoding program, you need to manipulate strings at a character level. Python offers two primary methods for this:
To ensure your encoding and decoding functions work correctly, test them with a variety of inputs:
Every time you send a text message, post on social media, or visit a website, your words are being translated into a language of 0s and 1s behind the scenes. This process is called , and it is the foundation of all digital communication. | Mistake | Why It Happens | Fix
You can use this simplified table to fill in the CodeHS metadata requirement: Binary Code Verification Checklist
Automated unit tests on CodeHS look for exact parameter matching. If your phrase utilizes uppercase characters ( HELLO ), make sure your dictionary explicitly contains uppercase character parameters rather than lowercase options.
To build this program successfully without breaking the CodeHS autograder, your code must follow a strict, logical sequence: | Test with "a b" to ensure spaces survive round-trip
If you want to customize this further or add a decryption feature, tell me:
This assignment teaches that binary encoding is fundamentally an agreement.
Loop through each character of the string and alter it. Output: Display the final encoded string to the console. Common Encoding Strategies