8.3 8 Create Your Own Encoding Codehs Answers 【RECOMMENDED — How-To】

def encode(s): mapping = 'a':1, 'b':2, 'c':3, ' ':0 return [mapping[ch] for ch in s]

In this basic implementation, 'z' will shift into the next ASCII character ('{'). If your assignment requires 'z' to wrap around to 'a', you would need to add a specific check: 8.3 8 create your own encoding codehs answers

Enter the key (binary) and value (character) for each of the 27 required entries. def encode(s): mapping = 'a':1, 'b':2, 'c':3, '

The most effective way to approach 8.3.8 is to define two strings: one representing the standard alphabet and one representing your "cipher" (the encoded version). abcdefghijklmnopqrstuvwxyz def encode(s): mapping = 'a':1

Was this article helpful?

Share your feedback

Cancel

Thank you!