8.3 8: Create Your Own Encoding Codehs Answers

Fix: Build fresh dictionaries inside functions or pass them as parameters.

Fix: Test decode(encode("Test")) == "Test" after every change. 8.3 8 create your own encoding codehs answers

Plaintext: "CS IS FUN."

  • Decoding follows the Decode pseudocode above.

  • alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ "
    def encode_custom(msg):
        return [alphabet.index(ch.upper()) for ch in msg if ch in alphabet]
    

    Note: This loses case information and only works for letters+space. Fix: Build fresh dictionaries inside functions or pass

    Discover more from DJBooth

    Subscribe now to keep reading and get access to the full archive.

    Continue reading