The assignment relies on . RLE is a form of lossless data compression where runs of data (sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original run. The Encoding Process
Transforming structured operational data into flat streams suitable for transmission or storage.
Yes, this exercise is typically done in Python, where you map characters to strings of '1's and '0's. Why 5 bits?
You can copy and paste this code directly into your CodeHS editor. 83 8 create your own encoding codehs answers exclusive
alphabet = " abcdefghijklmnopqrstuvwxyz"
Since this is a partner exercise, both users must use the exact same key/table to ensure messages encoded by one can be decoded by the other.
def encode(message): result = [] for ch in message: result.append(ord(ch) + 10) # shift ASCII by 10 return result The assignment relies on
This solution uses a 5‑bit encoding for the lowercase alphabet plus space.
虽然CodeHS不强制要求你们使用某种特定的编码顺序,但为了让编码真正具有,你和搭档可以:
将这些二进制码按顺序拼接起来(): Yes, this exercise is typically done in Python,
Most students use fixed-length (all characters are 5 bits) for simplicity, which makes decoding easier because you can just split the string every 5 characters.
| 字符 | 二进制 (5‑bit) | 十进制 | |------|----------------|--------| | A | 00000 | 0 | | B | 00001 | 1 | | C | 00010 | 2 | | … | … | … | | Z | 11001 | 25 | | 空格 | 11010 | 26 |
). In the CodeHS interface, you will typically enter these into the metadata or side panel keys.
The CodeHS 8.3.8 "Create your own Encoding" activity requires developing a 5-bit binary scheme to represent 26 capital letters (A–Z) and a space character efficiently. By using a 5-bit mapping (2^5=32), users can map characters sequentially from 'A' (00000) to space (11010) to meet the minimum bit requirements. For a detailed breakdown and examples, visit